Class BeanWrapperExpressionParser
java.lang.Object
org.springframework.binding.expression.support.AbstractExpressionParser
org.springframework.binding.expression.beanwrapper.BeanWrapperExpressionParser
- All Implemented Interfaces:
ExpressionParser
An expression parser that parses BeanWrapper property expressions.
- Author:
- Keith Donald
-
Constructor Summary
ConstructorDescriptionCreates a new expression parser that uses aDefaultConversionService
to perform type conversion.BeanWrapperExpressionParser
(ConversionService conversionService) Creates a new expression parser that uses the specified conversion service for type conversion. -
Method Summary
Modifier and TypeMethodDescriptionprotected Expression
doParseExpression
(String expressionString, ParserContext context) The conversion service to use to obtainconversion executors
that will be adapted toproperty editors
for use during aset value
call.void
setAutoGrowCollectionLimit
(int autoGrowCollectionLimit) Specify a limit for array and collection auto-growing.void
setAutoGrowNestedPaths
(boolean autoGrowNestedPaths) Set whether this BeanWrapper should attempt to "auto-grow" a nested path that contains a null value.void
setConversionService
(ConversionService conversionService) Sets the conversion service to use to obtainconversion executors
that will be adapted toproperty editors
for use during aset value
call.Methods inherited from class org.springframework.binding.expression.support.AbstractExpressionParser
getAllowDelimitedEvalExpressions, getExpressionPrefix, getExpressionSuffix, parseExpression, parseVariableExpressions, setAllowDelimitedEvalExpressions, setExpressionPrefix, setExpressionSuffix
-
Constructor Details
-
BeanWrapperExpressionParser
public BeanWrapperExpressionParser()Creates a new expression parser that uses aDefaultConversionService
to perform type conversion. -
BeanWrapperExpressionParser
Creates a new expression parser that uses the specified conversion service for type conversion.- Parameters:
conversionService
- the conversion service to use
-
-
Method Details
-
getConversionService
The conversion service to use to obtainconversion executors
that will be adapted toproperty editors
for use during aset value
call. The default if not specified is an instance ofDefaultConversionService
. -
setConversionService
Sets the conversion service to use to obtainconversion executors
that will be adapted toproperty editors
for use during aset value
call.- Parameters:
conversionService
- the conversion service
-
setAutoGrowNestedPaths
public 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.
-
setAutoGrowCollectionLimit
public void setAutoGrowCollectionLimit(int autoGrowCollectionLimit) Specify a limit for array and collection auto-growing.Default is unlimited on a plain BeanWrapper.
-
doParseExpression
protected Expression doParseExpression(String expressionString, ParserContext context) throws ParserException - Specified by:
doParseExpression
in classAbstractExpressionParser
- Throws:
ParserException
-