|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.binding.expression.beanwrapper.BeanWrapperExpression
public class BeanWrapperExpression
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.
Constructor Summary | |
---|---|
BeanWrapperExpression(String expression,
ConversionService conversionService)
Creates a new bean wrapper expression. |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
String |
getExpressionString()
Returns the original string used to create this expression, unmodified. |
Object |
getValue(Object context)
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 the Expression.setValue(Object, Object) method for the given
context. |
int |
hashCode()
|
void |
setValue(Object context,
Object value)
Set this expression in the provided context to the value provided. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BeanWrapperExpression(String expression, ConversionService conversionService)
expression
- the property expression stringconversionService
- the conversion service containing converters to use as PropertyEditors for type
conversionMethod Detail |
---|
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public Object getValue(Object context) throws EvaluationException
Expression
getValue
in interface Expression
context
- the context to evaluate this expression in
EvaluationException
- an exception occurred during expression evaluationpublic void setValue(Object context, Object value)
Expression
setValue
in interface Expression
context
- the context on which the new value should be setvalue
- the new value to setpublic Class getValueType(Object context)
Expression
Expression.setValue(Object, Object)
method for the given
context.
getValueType
in interface Expression
context
- the context to evaluate
null
if the type
information cannot be determinedpublic String getExpressionString()
Expression
getExpressionString
in interface Expression
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |