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


Java PropertyAccessorUtils.canonicalPropertyNames方法代码示例

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


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

示例1: setRequiredFields

import org.springframework.beans.PropertyAccessorUtils; //导入方法依赖的package包/类
/**
 * Register fields that are required for each binding process.
 * <p>If one of the specified fields is not contained in the list of
 * incoming property values, a corresponding "missing field" error
 * will be created, with error code "required" (by the default
 * binding error processor).
 * @param requiredFields array of field names
 * @see #setBindingErrorProcessor
 * @see DefaultBindingErrorProcessor#MISSING_FIELD_ERROR_CODE
 */
public void setRequiredFields(String... requiredFields) {
	this.requiredFields = PropertyAccessorUtils.canonicalPropertyNames(requiredFields);
	if (logger.isDebugEnabled()) {
		logger.debug("DataBinder requires binding of required fields [" +
				StringUtils.arrayToCommaDelimitedString(requiredFields) + "]");
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:DataBinder.java

示例2: setAllowedFields

import org.springframework.beans.PropertyAccessorUtils; //导入方法依赖的package包/类
/**
 * Register fields that should be allowed for binding. Default is all
 * fields. Restrict this for example to avoid unwanted modifications
 * by malicious users when binding HTTP request parameters.
 * <p>Supports "xxx*", "*xxx" and "*xxx*" patterns. More sophisticated matching
 * can be implemented by overriding the {@code isAllowed} method.
 * <p>Alternatively, specify a list of <i>disallowed</i> fields.
 * @param allowedFields array of field names
 * @see #setDisallowedFields
 * @see #isAllowed(String)
 * @see org.springframework.web.bind.ServletRequestDataBinder
 */
public void setAllowedFields(String... allowedFields) {
	this.allowedFields = PropertyAccessorUtils.canonicalPropertyNames(allowedFields);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:DataBinder.java

示例3: setDisallowedFields

import org.springframework.beans.PropertyAccessorUtils; //导入方法依赖的package包/类
/**
 * Register fields that should <i>not</i> be allowed for binding. Default is none.
 * Mark fields as disallowed for example to avoid unwanted modifications
 * by malicious users when binding HTTP request parameters.
 * <p>Supports "xxx*", "*xxx" and "*xxx*" patterns. More sophisticated matching
 * can be implemented by overriding the {@code isAllowed} method.
 * <p>Alternatively, specify a list of <i>allowed</i> fields.
 * @param disallowedFields array of field names
 * @see #setAllowedFields
 * @see #isAllowed(String)
 * @see org.springframework.web.bind.ServletRequestDataBinder
 */
public void setDisallowedFields(String... disallowedFields) {
	this.disallowedFields = PropertyAccessorUtils.canonicalPropertyNames(disallowedFields);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:DataBinder.java


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