Class PropertyResolverImpl
public class PropertyResolverImpl extends PropertyResolver
Concrete implementation of PropertyResolver.
-
Constructor Summary
Constructors Constructor Description PropertyResolverImpl() -
Method Summary
Modifier and Type Method Description protected static voidassertInput(Object base, int index)protected static voidassertInput(Object base, Object property)ClassgetType(Object base, int index)Return thejava.lang.Classrepresenting the type of the specified index.ClassgetType(Object base, Object property)Return thejava.lang.Classrepresenting the type of the specified property.ObjectgetValue(Object base, int index)Return the value at the specified index of the specified base object.ObjectgetValue(Object base, Object property)Return the value of the specified property from the specified base object.booleanisReadOnly(Object base, int index)Checks if the specified index is read-only.booleanisReadOnly(Object base, Object property)Checks if the specified property is read-only.voidsetDelegate(PropertyResolver delegate)voidsetValue(Object base, int index, Object value)Set the value at the specified index of the specified base object.voidsetValue(Object base, Object property, Object value)Set the specified value of the specified property on the specified base object.
-
Constructor Details
-
PropertyResolverImpl
public PropertyResolverImpl()
-
-
Method Details
-
getType
Description copied from class:PropertyResolverReturn the
java.lang.Classrepresenting the type of the specified index.- Specified by:
getTypein classPropertyResolver- Parameters:
base- The base object whose property is to be analyzedindex- The index of the value whose type is to be returned- Returns:
- The
java.lang.Classrepresenting the type of value at the specified index of the specified base object, if it can be determined; otherwisenull - Throws:
EvaluationException- if an exception is thrown while testing the property (the thrown exception must be included as thecauseproperty of this exception)PropertyNotFoundException- if the index is out of bounds or ifbaseisnull
-
getType
Description copied from class:PropertyResolverReturn the
java.lang.Classrepresenting the type of the specified property. An instance of any Object of that type my be set as the value of that property, as long as the property is not read-only. The actual value of the property, if non-null, is guaranteed to be an instance of this type, or an instance of a subclass of this type. This method is also useful for discovering the type of Objects that may be set as the value of the property.For a bean base object, the property is coerced to a
Stringand used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.- Specified by:
getTypein classPropertyResolver- Parameters:
base- The base object whose property is to be analyzedproperty- The property to be analyzed- Returns:
- the
java.lang.Classrepresenting the type of the specified property of the specified base object, if it can be determined; otherwisenull
-
getValue
Description copied from class:PropertyResolverReturn the value at the specified index of the specified base object.
- Specified by:
getValuein classPropertyResolver- Parameters:
base- The base object whose property value is to be returnedindex- The index of the value to return- Returns:
- The property value, or
nullifbaseisnull, or if the index is out of bounds for the base object
-
getValue
Description copied from class:PropertyResolverReturn the value of the specified property from the specified base object.
For a bean base object, the property is coerced to a
Stringand used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.- Specified by:
getValuein classPropertyResolver- Parameters:
base- The base object whose property value is to be returnedproperty- The property to be returned- Returns:
- The property value, or
nullifbaseorpropertyisnull, or if the property doesn't exist and the base object is aMapinstance
-
isReadOnly
Description copied from class:PropertyResolverChecks if the specified index is read-only.
- Specified by:
isReadOnlyin classPropertyResolver- Parameters:
base- The base object whose property is to be analyzedindex- The index of the value whose type is to be returned- Returns:
trueif the value at the specified index of the specified base object is known to be immutable; otherwise,false
-
isReadOnly
Description copied from class:PropertyResolverChecks if the specified property is read-only.
For a bean base object, the property is coerced to a
Stringand used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.- Specified by:
isReadOnlyin classPropertyResolver- Parameters:
base- The base object whose property is to be analyzedproperty- The property to be analyzed- Returns:
trueif the specified property of the specified base object is known to be immutable; otherwisefalse
-
setValue
Description copied from class:PropertyResolverSet the value at the specified index of the specified base object.
- Specified by:
setValuein classPropertyResolver- Parameters:
base- The base object whose property value is to be setindex- The index of the value to setvalue- The value to be set
-
setValue
Description copied from class:PropertyResolverSet the specified value of the specified property on the specified base object.
For a bean base object, the property is coerced to a
Stringand used as the property name. For all other base object types (e.g., a Map), the property is used without any coercing.- Specified by:
setValuein classPropertyResolver- Parameters:
base- The base object whose property value is to be setproperty- The property to be setvalue- The value of the property to be set
-
setDelegate
-
assertInput
- Throws:
PropertyNotFoundException
-
assertInput
- Throws:
PropertyNotFoundException
-