Class BeanWrapperExpression
java.lang.Object
org.springframework.binding.expression.beanwrapper.BeanWrapperExpression
- All Implemented Interfaces:
- Expression
An expression that delegates to a 
bean wrapper to evaluate or set a property of a context.
 Also supports the configuration of a ConversionService to allow StringToObject type conversion to occur as
 part of setting a property. The StringToObject ConversionExecutors are automatically adapted and registered as
 PropertyEditors.
 Mainly exists to take advantage of BeanWrapper's unique property access features as an Expression implementation,
 notably the ability to infer types of generic collections and maps and perform type coersion on collection elements
 when setting values.
 Note that Spring's BeanWrapper is not a full-blown EL implementation: it only supports property access, and does not
 support method invocation, arithmetic operations, or logic operations.- Author:
- Keith Donald, Scott Andrews
- 
Constructor SummaryConstructorsConstructorDescriptionBeanWrapperExpression(String expression, ConversionService conversionService) Creates a new bean wrapper expression.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns the original string used to create this expression, unmodified.Evaluate this expression in the provided context and return the result of evaluation.Class<?>getValueType(Object context) Returns the most general type that can be passed to theExpression.setValue(Object, Object)method for the given context.inthashCode()voidsetAutoGrowCollectionLimit(int autoGrowCollectionLimit) Specify a limit for array and collection auto-growing.voidsetAutoGrowNestedPaths(boolean autoGrowNestedPaths) Set whether this BeanWrapper should attempt to "auto-grow" a nested path that contains a null value.voidSet this expression in the provided context to the value provided.toString()
- 
Constructor Details- 
BeanWrapperExpressionCreates a new bean wrapper expression.- Parameters:
- expression- the property expression string
- conversionService- the conversion service containing converters to use as PropertyEditors for type conversion
 
 
- 
- 
Method Details- 
setAutoGrowNestedPathspublic void setAutoGrowNestedPaths(boolean autoGrowNestedPaths) Set whether this BeanWrapper should attempt to "auto-grow" a nested path that contains a null value.If "true", a null path location will be populated with a default object value and traversed instead of resulting in a NullValueInNestedPathException. Turning this flag on also enables auto-growth of collection elements when accessing an out-of-bounds index.Default is "false" on a plain BeanWrapper. 
- 
setAutoGrowCollectionLimitpublic void setAutoGrowCollectionLimit(int autoGrowCollectionLimit) Specify a limit for array and collection auto-growing.Default is unlimited on a plain BeanWrapper. 
- 
equals
- 
hashCodepublic int hashCode()
- 
getValueDescription copied from interface:ExpressionEvaluate this expression in the provided context and return the result of evaluation.- Specified by:
- getValuein interface- Expression
- Parameters:
- context- the context to evaluate this expression in
- Returns:
- the evaluation result
- Throws:
- EvaluationException- an exception occurred during expression evaluation
 
- 
setValueDescription copied from interface:ExpressionSet this expression in the provided context to the value provided.- Specified by:
- setValuein interface- Expression
- Parameters:
- context- the context on which the new value should be set
- value- the new value to set
 
- 
getValueTypeDescription copied from interface:ExpressionReturns the most general type that can be passed to theExpression.setValue(Object, Object)method for the given context.- Specified by:
- getValueTypein interface- Expression
- Parameters:
- context- the context to evaluate
- Returns:
- the most general type of value that can be set on this context, or nullif the type information cannot be determined
 
- 
getExpressionStringDescription copied from interface:ExpressionReturns the original string used to create this expression, unmodified.- Specified by:
- getExpressionStringin interface- Expression
- Returns:
- the original expression string
 
- 
toString
 
-