Mainly for use within the framework and in particular the binding facility.
forProperty(String, Class), forField(String, Class)
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DEFAULT_MAX_DISTANCE
Default maximum property distance: 2. |
| private final String[] | |
| private final String |
| Access | Constructor and Description |
|---|---|
| private | PropertyMatches(String propertyName, String[] possibleMatches)
Create a new PropertyMatches instance for the given property and possible matches. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public abstract String | buildErrorMessage()
Build an error message for the given invalid property name, indicating the possible property matches. |
| private static int | Returns: the distance valuethe first String s1, String the second String s2)Calculate the distance between the given two Strings according to the Levenshtein algorithm. |
| public static PropertyMatches | |
| public static PropertyMatches | |
| public static PropertyMatches | forProperty(String
the name of the property to find possible matches for propertyName, Class<?> the bean class to search for matches beanClass)Create PropertyMatches for the given bean property. |
| public static PropertyMatches | forProperty(String
the name of the property to find possible matches for propertyName, Class<?> the bean class to search for matches beanClass, int the maximum property distance allowed for matches maxDistance)Create PropertyMatches for the given bean property. |
| public String[] | |
| public String |
| DEFAULT_MAX_DISTANCE | back to summary |
|---|---|
| public static final int DEFAULT_MAX_DISTANCE Default maximum property distance: 2. | |
| possibleMatches | back to summary |
|---|---|
| private final String[] possibleMatches | |
| propertyName | back to summary |
|---|---|
| private final String propertyName | |
| PropertyMatches | back to summary |
|---|---|
| private PropertyMatches(String propertyName, String[] possibleMatches) Create a new PropertyMatches instance for the given property and possible matches. | |
| appendHintMessage | back to summary |
|---|---|
| protected void appendHintMessage(StringBuilder msg) | |
| buildErrorMessage | back to summary |
|---|---|
| public abstract String buildErrorMessage() Build an error message for the given invalid property name, indicating the possible property matches. | |
| calculateStringDistance | back to summary |
|---|---|
| private static int calculateStringDistance(String s1, String s2) Calculate the distance between the given two Strings according to the Levenshtein algorithm. | |
| forField | back to summary |
|---|---|
| public static PropertyMatches forField(String propertyName, Class<?> beanClass) Create PropertyMatches for the given field property. | |
| forField | back to summary |
|---|---|
| public static PropertyMatches forField(String propertyName, Class<?> beanClass, int maxDistance) Create PropertyMatches for the given field property. | |
| forProperty | back to summary |
|---|---|
| public static PropertyMatches forProperty(String propertyName, Class<?> beanClass) Create PropertyMatches for the given bean property. | |
| forProperty | back to summary |
|---|---|
| public static PropertyMatches forProperty(String propertyName, Class<?> beanClass, int maxDistance) Create PropertyMatches for the given bean property. | |
| getPossibleMatches | back to summary |
|---|---|
| public String[] getPossibleMatches() Return the calculated possible matches. | |
| getPropertyName | back to summary |
|---|---|
| public String getPropertyName() Return the name of the requested property. | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | buildErrorMessage()
Implements abstract org. Build an error message for the given invalid property name, indicating the possible property matches. |
| private static String[] | calculateMatches(String name, PropertyDescriptor[]
the JavaBeans property descriptors to search descriptors, int the maximum distance to accept maxDistance)Generate possible property alternatives for the given property and class. |
| BeanPropertyMatches | back to summary |
|---|---|
| public BeanPropertyMatches(String propertyName, Class<?> beanClass, int maxDistance) | |
| buildErrorMessage | back to summary |
|---|---|
| public String buildErrorMessage() Implements abstract org. Doc from org. Build an error message for the given invalid property name, indicating the possible property matches.
| |
| calculateMatches | back to summary |
|---|---|
| private static String[] calculateMatches(String name, PropertyDescriptor[] descriptors, int maxDistance) Generate possible property alternatives for the given property and class.
Internally uses the
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | buildErrorMessage()
Implements abstract org. Build an error message for the given invalid property name, indicating the possible property matches. |
| private static String[] |
| FieldPropertyMatches | back to summary |
|---|---|
| public FieldPropertyMatches(String propertyName, Class<?> beanClass, int maxDistance) | |
| buildErrorMessage | back to summary |
|---|---|
| public String buildErrorMessage() Implements abstract org. Doc from org. Build an error message for the given invalid property name, indicating the possible property matches.
| |
| calculateMatches | back to summary |
|---|---|
| private static String[] calculateMatches(final String name, Class<?> clazz, final int maxDistance) | |