private static class PropertyMatches.BeanPropertyMatches extends PropertyMatches
DEFAULT_MAX_DISTANCE
Constructor and Description |
---|
BeanPropertyMatches(java.lang.String propertyName,
java.lang.Class<?> beanClass,
int maxDistance) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
buildErrorMessage()
Build an error message for the given invalid property name,
indicating the possible property matches.
|
private static java.lang.String[] |
calculateMatches(java.lang.String propertyName,
java.beans.PropertyDescriptor[] propertyDescriptors,
int maxDistance)
Generate possible property alternatives for the given property and
class.
|
appendHintMessage, forField, forField, forProperty, forProperty, getPossibleMatches, getPropertyName
public BeanPropertyMatches(java.lang.String propertyName, java.lang.Class<?> beanClass, int maxDistance)
private static java.lang.String[] calculateMatches(java.lang.String propertyName, java.beans.PropertyDescriptor[] propertyDescriptors, int maxDistance)
getStringDistance
method, which
in turn uses the Levenshtein algorithm to determine the distance between
two Strings.propertyDescriptors
- the JavaBeans property descriptors to searchmaxDistance
- the maximum distance to acceptpublic java.lang.String buildErrorMessage()
PropertyMatches
buildErrorMessage
in class PropertyMatches