The Spring Framework

org.springframework.beans
Class PropertyMatches

java.lang.Object
  extended by org.springframework.beans.PropertyMatches

final class PropertyMatches
extends Object

Helper class for calculating bean property matches, according to. Used by BeanWrapperImpl to suggest alternatives for an invalid property name.

Since:
2.0
Author:
Alef Arendsen, Arjen Poutsma, Juergen Hoeller
See Also:
forProperty(String, Class)

Field Summary
static int DEFAULT_MAX_DISTANCE
          Default maximum property distance: 2
 
Method Summary
 String buildErrorMessage()
          Build an error message for the given invalid property name, indicating the possible property matches.
static PropertyMatches forProperty(String propertyName, Class beanClass)
          Create PropertyMatches for the given bean property.
static PropertyMatches forProperty(String propertyName, Class beanClass, int maxDistance)
          Create PropertyMatches for the given bean property.
 String[] getPossibleMatches()
          Return the calculated possible matches.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_DISTANCE

public static final int DEFAULT_MAX_DISTANCE
Default maximum property distance: 2

See Also:
Constant Field Values
Method Detail

forProperty

public static PropertyMatches forProperty(String propertyName,
                                          Class beanClass)
Create 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

forProperty

public static PropertyMatches forProperty(String propertyName,
                                          Class beanClass,
                                          int maxDistance)
Create 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

getPossibleMatches

public String[] getPossibleMatches()
Return the calculated possible matches.


buildErrorMessage

public String buildErrorMessage()
Build an error message for the given invalid property name, indicating the possible property matches.


The Spring Framework

Copyright © 2002-2006 The Spring Framework.