Package org.springframework.beans
Class PropertyMatches
java.lang.Object
org.springframework.beans.PropertyMatches
Helper class for calculating property matches, according to a configurable
 distance. Provide the list of potential matches and an easy way to generate
 an error message. Works for both java bean properties and fields.
 
Mainly for use within the framework and in particular the binding facility.
- Since:
- 2.0
- Author:
- Alef Arendsen, Arjen Poutsma, Juergen Hoeller, Stephane Nicoll
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intDefault maximum property distance: 2.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidabstract StringBuild an error message for the given invalid property name, indicating the possible property matches.static PropertyMatchesCreate PropertyMatches for the given field property.static PropertyMatchesCreate PropertyMatches for the given field property.static PropertyMatchesforProperty(String propertyName, Class<?> beanClass) Create PropertyMatches for the given bean property.static PropertyMatchesforProperty(String propertyName, Class<?> beanClass, int maxDistance) Create PropertyMatches for the given bean property.String[]Return the calculated possible matches.Return the name of the requested property.
- 
Field Details- 
DEFAULT_MAX_DISTANCEpublic static final int DEFAULT_MAX_DISTANCEDefault maximum property distance: 2.- See Also:
 
 
- 
- 
Method Details- 
forPropertyCreate PropertyMatches for the given bean property.- Parameters:
- propertyName- the name of the property to find possible matches for
- beanClass- the bean class to search for matches
 
- 
forPropertyCreate PropertyMatches for the given bean property.- Parameters:
- propertyName- the name of the property to find possible matches for
- beanClass- the bean class to search for matches
- maxDistance- the maximum property distance allowed for matches
 
- 
forFieldCreate PropertyMatches for the given field property.- Parameters:
- propertyName- the name of the field to find possible matches for
- beanClass- the bean class to search for matches
 
- 
forFieldCreate PropertyMatches for the given field property.- Parameters:
- propertyName- the name of the field to find possible matches for
- beanClass- the bean class to search for matches
- maxDistance- the maximum property distance allowed for matches
 
- 
getPropertyNameReturn the name of the requested property.
- 
getPossibleMatchesReturn the calculated possible matches.
- 
buildErrorMessageBuild an error message for the given invalid property name, indicating the possible property matches.
- 
appendHintMessage
 
-