Class FunctionExpression<S>
java.lang.Object
org.springframework.integration.expression.FunctionExpression<S>
- Type Parameters:
- S- The evaluation context root object type.
- All Implemented Interfaces:
- Expression
An 
Expression that simply invokes Function.apply(Object) on its
 provided Function.
 This is a powerful alternative to the SpEL, when Java 8 and its Lambda support is in use.
 If the target component has support for an Expression property,
 a FunctionExpression can be specified instead of a
 SpelExpression
 as an alternative to evaluate the value from the Lambda, rather than runtime SpEL resolution.
 
 The FunctionExpression is 'read-only', hence only getValue() operations
 are allowed.
 Any setValue(org.springframework.expression.EvaluationContext, java.lang.Object) operations and getValueType() related operations
 throw EvaluationException.
- Since:
- 5.0
- Author:
- Artem Bilan, Gary Russell
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal StringgetValue()<T> T<T> TgetValue(EvaluationContext context) <T> TgetValue(EvaluationContext context, Class<T> desiredResultType) getValue(EvaluationContext context, Object rootObject) <T> TgetValue(EvaluationContext context, Object rootObject, Class<T> desiredResultType) Class<?>Class<?>getValueType(Object rootObject) Class<?>getValueType(EvaluationContext context) Class<?>getValueType(EvaluationContext context, Object rootObject) getValueTypeDescriptor(Object rootObject) getValueTypeDescriptor(EvaluationContext context) getValueTypeDescriptor(EvaluationContext context, Object rootObject) booleanisWritable(Object rootObject) booleanisWritable(EvaluationContext context) booleanisWritable(EvaluationContext context, Object rootObject) voidvoidsetValue(EvaluationContext context, Object value) voidsetValue(EvaluationContext context, Object rootObject, Object value) 
- 
Constructor Details- 
FunctionExpression
 
- 
- 
Method Details- 
getValue- Specified by:
- getValuein interface- Expression
- Throws:
- EvaluationException
 
- 
getValue- Specified by:
- getValuein interface- Expression
- Throws:
- EvaluationException
 
- 
getValue- Specified by:
- getValuein interface- Expression
- Throws:
- EvaluationException
 
- 
getValue@Nullable public <T> T getValue(@Nullable Object rootObject, @Nullable Class<T> desiredResultType) throws EvaluationException - Specified by:
- getValuein interface- Expression
- Throws:
- EvaluationException
 
- 
getValue- Specified by:
- getValuein interface- Expression
- Throws:
- EvaluationException
 
- 
getValue@Nullable public Object getValue(EvaluationContext context, @Nullable Object rootObject) throws EvaluationException - Specified by:
- getValuein interface- Expression
- Throws:
- EvaluationException
 
- 
getValue@Nullable public <T> T getValue(EvaluationContext context, @Nullable Class<T> desiredResultType) throws EvaluationException - Specified by:
- getValuein interface- Expression
- Throws:
- EvaluationException
 
- 
getValue@Nullable public <T> T getValue(EvaluationContext context, @Nullable Object rootObject, @Nullable Class<T> desiredResultType) throws EvaluationException - Specified by:
- getValuein interface- Expression
- Throws:
- EvaluationException
 
- 
getValueType- Specified by:
- getValueTypein interface- Expression
- Throws:
- EvaluationException
 
- 
getValueType- Specified by:
- getValueTypein interface- Expression
- Throws:
- EvaluationException
 
- 
getValueType- Specified by:
- getValueTypein interface- Expression
- Throws:
- EvaluationException
 
- 
getValueTypepublic Class<?> getValueType(EvaluationContext context, @Nullable Object rootObject) throws EvaluationException - Specified by:
- getValueTypein interface- Expression
- Throws:
- EvaluationException
 
- 
getValueTypeDescriptor- Specified by:
- getValueTypeDescriptorin interface- Expression
- Throws:
- EvaluationException
 
- 
getValueTypeDescriptorpublic TypeDescriptor getValueTypeDescriptor(@Nullable Object rootObject) throws EvaluationException - Specified by:
- getValueTypeDescriptorin interface- Expression
- Throws:
- EvaluationException
 
- 
getValueTypeDescriptor- Specified by:
- getValueTypeDescriptorin interface- Expression
- Throws:
- EvaluationException
 
- 
getValueTypeDescriptorpublic TypeDescriptor getValueTypeDescriptor(EvaluationContext context, @Nullable Object rootObject) throws EvaluationException - Specified by:
- getValueTypeDescriptorin interface- Expression
- Throws:
- EvaluationException
 
- 
setValue- Specified by:
- setValuein interface- Expression
- Throws:
- EvaluationException
 
- 
setValuepublic void setValue(@Nullable Object rootObject, @Nullable Object value) throws EvaluationException - Specified by:
- setValuein interface- Expression
- Throws:
- EvaluationException
 
- 
setValuepublic void setValue(EvaluationContext context, @Nullable Object rootObject, @Nullable Object value) throws EvaluationException - Specified by:
- setValuein interface- Expression
- Throws:
- EvaluationException
 
- 
isWritable- Specified by:
- isWritablein interface- Expression
- Throws:
- EvaluationException
 
- 
isWritablepublic boolean isWritable(EvaluationContext context, @Nullable Object rootObject) throws EvaluationException - Specified by:
- isWritablein interface- Expression
- Throws:
- EvaluationException
 
- 
isWritable- Specified by:
- isWritablein interface- Expression
- Throws:
- EvaluationException
 
- 
getExpressionString- Specified by:
- getExpressionStringin interface- Expression
 
 
-