Java Code Examples for org.springframework.beans.PropertyAccessorUtils#canonicalPropertyNames()

The following examples show how to use org.springframework.beans.PropertyAccessorUtils#canonicalPropertyNames() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DataBinder.java    From spring-analysis-note with MIT License 3 votes vote down vote up
/**
 * 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(@Nullable String... requiredFields) {
	this.requiredFields = PropertyAccessorUtils.canonicalPropertyNames(requiredFields);
	if (logger.isDebugEnabled()) {
		logger.debug("DataBinder requires binding of required fields [" +
				StringUtils.arrayToCommaDelimitedString(requiredFields) + "]");
	}
}
 
Example 2
Source File: DataBinder.java    From java-technology-stack with MIT License 3 votes vote down vote up
/**
 * 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(@Nullable String... requiredFields) {
	this.requiredFields = PropertyAccessorUtils.canonicalPropertyNames(requiredFields);
	if (logger.isDebugEnabled()) {
		logger.debug("DataBinder requires binding of required fields [" +
				StringUtils.arrayToCommaDelimitedString(requiredFields) + "]");
	}
}
 
Example 3
Source File: DataBinder.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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) + "]");
	}
}
 
Example 4
Source File: DataBinder.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * 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) + "]");
	}
}
 
Example 5
Source File: DataBinder.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * 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)
 */
public void setAllowedFields(@Nullable String... allowedFields) {
	this.allowedFields = PropertyAccessorUtils.canonicalPropertyNames(allowedFields);
}
 
Example 6
Source File: DataBinder.java    From spring-analysis-note with MIT License 2 votes vote down vote up
/**
 * 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)
 */
public void setDisallowedFields(@Nullable String... disallowedFields) {
	this.disallowedFields = PropertyAccessorUtils.canonicalPropertyNames(disallowedFields);
}
 
Example 7
Source File: DataBinder.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * 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)
 */
public void setAllowedFields(@Nullable String... allowedFields) {
	this.allowedFields = PropertyAccessorUtils.canonicalPropertyNames(allowedFields);
}
 
Example 8
Source File: DataBinder.java    From java-technology-stack with MIT License 2 votes vote down vote up
/**
 * 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)
 */
public void setDisallowedFields(@Nullable String... disallowedFields) {
	this.disallowedFields = PropertyAccessorUtils.canonicalPropertyNames(disallowedFields);
}
 
Example 9
Source File: DataBinder.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * 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);
}
 
Example 10
Source File: DataBinder.java    From lams with GNU General Public License v2.0 2 votes vote down vote up
/**
 * 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);
}
 
Example 11
Source File: DataBinder.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * 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);
}
 
Example 12
Source File: DataBinder.java    From spring4-understanding with Apache License 2.0 2 votes vote down vote up
/**
 * 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);
}