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 name,
java.beans.PropertyDescriptor[] descriptors,
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 name, java.beans.PropertyDescriptor[] descriptors, int maxDistance)
getStringDistance
method, which in turn uses
the Levenshtein algorithm to determine the distance between two Strings.descriptors
- the JavaBeans property descriptors to searchmaxDistance
- the maximum distance to acceptpublic java.lang.String buildErrorMessage()
PropertyMatches
buildErrorMessage
in class PropertyMatches