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


Java PropertyAccessorUtils.canonicalPropertyName方法代码示例

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


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

示例1: checkAllowedFields

import org.springframework.beans.PropertyAccessorUtils; //导入方法依赖的package包/类
/**
 * Check the given property values against the allowed fields,
 * removing values for fields that are not allowed.
 * @param mpvs the property values to be bound (can be modified)
 * @see #getAllowedFields
 * @see #isAllowed(String)
 */
protected void checkAllowedFields(MutablePropertyValues mpvs) {
	PropertyValue[] pvs = mpvs.getPropertyValues();
	for (PropertyValue pv : pvs) {
		String field = PropertyAccessorUtils.canonicalPropertyName(pv.getName());
		if (!isAllowed(field)) {
			mpvs.removePropertyValue(pv);
			getBindingResult().recordSuppressedField(field);
			if (logger.isDebugEnabled()) {
				logger.debug("Field [" + field + "] has been removed from PropertyValues " +
						"and will not be bound, because it has not been found in the list of allowed fields");
			}
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:22,代码来源:DataBinder.java

示例2: doSetNestedPath

import org.springframework.beans.PropertyAccessorUtils; //导入方法依赖的package包/类
/**
 * Actually set the nested path.
 * Delegated to by setNestedPath and pushNestedPath.
 * <p/>
 * Note: Not yet known what to use the path for. Possibly if the Asset has
 * second class Asset contained inside it.
 *
 * @param nestedPath Path
 */
protected void doSetNestedPath(String nestedPath) {
    if (nestedPath == null) {
        nestedPath = "";
    }
    nestedPath = PropertyAccessorUtils.canonicalPropertyName(nestedPath);
    if (nestedPath.length() > 0 && !nestedPath.endsWith(NESTED_PATH_SEPARATOR)) {
        nestedPath += NESTED_PATH_SEPARATOR;
    }
    this.nestedPath = nestedPath;
}
 
开发者ID:jaschenk,项目名称:jeffaschenk-commons,代码行数:20,代码来源:ErrorsImpl.java

示例3: fixedField

import org.springframework.beans.PropertyAccessorUtils; //导入方法依赖的package包/类
/**
 * Transform the given field into its full path,
 * regarding the nested path of this instance.
 *
 * @param field a {@link java.lang.String} object.
 * @return  {@link java.lang.String} object.
 */
protected String fixedField(String field) {
    if (StringUtils.hasLength(field)) {
        return getNestedPath() + PropertyAccessorUtils.canonicalPropertyName(field);
    } else {
        String path = getNestedPath();
        return (path.endsWith(org.springframework.validation.Errors.NESTED_PATH_SEPARATOR) ?
                path.substring(0, path.length() - NESTED_PATH_SEPARATOR.length()) : path);
    }
}
 
开发者ID:jaschenk,项目名称:jeffaschenk-commons,代码行数:17,代码来源:ErrorsImpl.java

示例4: PropertyPath

import org.springframework.beans.PropertyAccessorUtils; //导入方法依赖的package包/类
/**
 * <p>Constructor for PropertyPath.</p>
 *
 * @param nestedPath a {@link java.lang.String} object.
 */
public PropertyPath(String nestedPath) {
    String canonicalPath = PropertyAccessorUtils.canonicalPropertyName(nestedPath);
    int lastIndex = PropertyAccessorUtils.getLastNestedPropertySeparatorIndex(canonicalPath);
    if (lastIndex < 0) {
        propertyName = PropertyAccessorUtils.getPropertyName(canonicalPath);
        key = computeKey(canonicalPath);
    } 
    else {
        parent = new PropertyPath(canonicalPath.substring(0, lastIndex));
        String lastProperty = canonicalPath.substring(lastIndex+1);
        propertyName = PropertyAccessorUtils.getPropertyName(lastProperty);
        key = computeKey(lastProperty);
    }
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:20,代码来源:PropertyPath.java

示例5: canonicalFieldName

import org.springframework.beans.PropertyAccessorUtils; //导入方法依赖的package包/类
/**
 * Returns the canonical property name.
 * @see org.springframework.beans.PropertyAccessorUtils#canonicalPropertyName
 */
@Override
protected String canonicalFieldName(String field) {
	return PropertyAccessorUtils.canonicalPropertyName(field);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:9,代码来源:AbstractPropertyBindingResult.java


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