abstract class 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.
Author
Alef Arendsen
Author
Arjen Poutsma
Author
Juergen Hoeller
Author
Stephane Nicoll
Since
2.0
See Also
#forProperty(String, Class)#forField(String, Class)
static val DEFAULT_MAX_DISTANCE: Int
Default maximum property distance: 2 |
abstract fun buildErrorMessage(): String
Build an error message for the given invalid property name, indicating the possible property matches. |
|
open static fun forField(propertyName: String, beanClass: Class<*>): PropertyMatchesopen static fun forField(propertyName: String, beanClass: Class<*>, maxDistance: Int): PropertyMatches
Create PropertyMatches for the given field property. |
|
open static fun forProperty(propertyName: String, beanClass: Class<*>): PropertyMatchesopen static fun forProperty(propertyName: String, beanClass: Class<*>, maxDistance: Int): PropertyMatches
Create PropertyMatches for the given bean property. |
|
open fun getPossibleMatches(): Array<String>
Return the calculated possible matches. |
|
open fun getPropertyName(): String
Return the name of the requested property. |