Package net.shibboleth.ext.spring.util
Class SpringExpressionFunction<T,U>
- java.lang.Object
-
- net.shibboleth.ext.spring.util.AbstractSpringExpressionEvaluatorEx
-
- net.shibboleth.ext.spring.util.SpringExpressionFunction<T,U>
-
- Type Parameters:
T- type of inputU- type of output
- All Implemented Interfaces:
Function<T,U>
public class SpringExpressionFunction<T,U> extends AbstractSpringExpressionEvaluatorEx implements Function<T,U>
Function whose output is defined by an Spring EL expression.- Since:
- 5.4.0
-
-
Constructor Summary
Constructors Constructor Description SpringExpressionFunction(String expression)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Uapply(T input)Class<T>getInputType()Get the input type to be enforced.protected voidprepareContext(EvaluationContext context, Object... input)Pre-process the script context before execution.voidsetInputType(Class<T> type)Set the input type to be enforced.voidsetOutputType(Class<?> type)Set the output type to be enforced.voidsetReturnOnError(Object value)Set value to return if an error occurs.-
Methods inherited from class net.shibboleth.ext.spring.util.AbstractSpringExpressionEvaluatorEx
evaluate, getCustomObject, getOutputType, getReturnOnError, setCustomObject, setHideExceptions
-
-
-
-
Constructor Detail
-
SpringExpressionFunction
public SpringExpressionFunction(@Nonnull @NotEmpty @ParameterName(name="expression") String expression)
Constructor.- Parameters:
expression- the expression to evaluate
-
-
Method Detail
-
getInputType
@Nullable public Class<T> getInputType()
Get the input type to be enforced.- Returns:
- input type
-
setInputType
public void setInputType(@Nullable Class<T> type)Set the input type to be enforced.- Parameters:
type- input type
-
setOutputType
public void setOutputType(@Nullable Class<?> type)Set the output type to be enforced.- Overrides:
setOutputTypein classAbstractSpringExpressionEvaluatorEx- Parameters:
type- output type
-
setReturnOnError
public void setReturnOnError(@Nullable Object value)Set value to return if an error occurs.- Overrides:
setReturnOnErrorin classAbstractSpringExpressionEvaluatorEx- Parameters:
value- value to return
-
prepareContext
protected void prepareContext(@Nonnull EvaluationContext context, @Nullable Object... input)Pre-process the script context before execution.- Specified by:
prepareContextin classAbstractSpringExpressionEvaluatorEx- Parameters:
context- the expression contextinput- the inputs
-
-