当前位置: 首页>>代码示例>>Java>>正文


Java PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex方法代码示例

本文整理汇总了Java中org.springframework.beans.PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex方法的具体用法?Java PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex怎么用?Java PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.beans.PropertyAccessorUtils的用法示例。


在下文中一共展示了PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBeanWrapperForPropertyPath

import org.springframework.beans.PropertyAccessorUtils; //导入方法依赖的package包/类
/**
 * Overridden to copy property editor registration to the new bean wrapper.
 *
 * <p>This is necessary because spring only copies over the editors when a new bean wrapper is
 * created. The wrapper is then cached and use for subsequent calls. But the get calls could bring in
 * new custom editors we need to copy.</p>
 *
 * {@inheritDoc}
 */
@Override
protected BeanWrapperImpl getBeanWrapperForPropertyPath(String propertyPath) {
    BeanWrapperImpl beanWrapper = super.getBeanWrapperForPropertyPath(propertyPath);

    PropertyTokenHolder tokens = getPropertyNameTokens(propertyPath);
    String canonicalName = tokens.canonicalName;

    int pos = PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex(canonicalName);
    if (pos != -1) {
        canonicalName = canonicalName.substring(0, pos);
    }

    copyCustomEditorsTo(beanWrapper, canonicalName);

    return beanWrapper;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:UifViewBeanWrapper.java

示例2: getBeanWrapperForPropertyPath

import org.springframework.beans.PropertyAccessorUtils; //导入方法依赖的package包/类
@Override
protected BeanWrapperImpl getBeanWrapperForPropertyPath(String propertyPath) {
    BeanWrapperImpl beanWrapper = super.getBeanWrapperForPropertyPath(propertyPath);

    PropertyTokenHolder tokens = getPropertyNameTokens(propertyPath);
    String canonicalName = tokens.canonicalName;

    int pos = PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex(canonicalName);
    if (pos != -1) {
        canonicalName = canonicalName.substring(0, pos);
    }

    copyCustomEditorsTo(beanWrapper, canonicalName);

    return beanWrapper;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:17,代码来源:UifViewBeanWrapper.java

示例3: getPropertyDescriptorForPropertyPath

import org.springframework.beans.PropertyAccessorUtils; //导入方法依赖的package包/类
/**
     * Recursively navigate to return a BeanWrapper for the nested property path.
     *
     * @param propertyPath
     *         property property path, which may be nested
     * @return a BeanWrapper for the target bean
     */
    PropertyDescriptor getPropertyDescriptorForPropertyPath(String propertyPath, Class<?> propertyType) {
        int pos = PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex(propertyPath);
        // Handle nested properties recursively.
        if (pos > -1) {
            String nestedProperty = propertyPath.substring(0, pos);
            String nestedPath = propertyPath.substring(pos + 1);
            PropertyDescriptor propertyDescriptor = BeanUtils.getPropertyDescriptor(propertyType, nestedProperty);
//            BeanWrapperImpl nestedBw = getNestedBeanWrapper(nestedProperty);
            return getPropertyDescriptorForPropertyPath(nestedPath, propertyDescriptor.getPropertyType());
        } else {
            return BeanUtils.getPropertyDescriptor(propertyType, propertyPath);
        }
    }
 
开发者ID:dschulten,项目名称:hydra-java,代码行数:21,代码来源:SpringActionDescriptor.java


注:本文中的org.springframework.beans.PropertyAccessorUtils.getFirstNestedPropertySeparatorIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。