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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the input type to be enforced.protected void
prepareContext
(EvaluationContext context, Object... input) Pre-process the script context before execution.void
setInputType
(Class<T> type) Set the input type to be enforced.void
setOutputType
(Class<?> type) Set the output type to be enforced.void
setReturnOnError
(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
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
inputType
The input type.
-
-
Constructor Details
-
SpringExpressionFunction
public SpringExpressionFunction(@Nonnull @NotEmpty @ParameterName(name="expression") String expression) Constructor.- Parameters:
expression
- the expression to evaluate
-
-
Method Details
-
getInputType
Get the input type to be enforced.- Returns:
- input type
-
setInputType
Set the input type to be enforced.- Parameters:
type
- input type
-
setOutputType
Set the output type to be enforced.- Overrides:
setOutputType
in classAbstractSpringExpressionEvaluatorEx
- Parameters:
type
- output type
-
setReturnOnError
Set value to return if an error occurs.- Overrides:
setReturnOnError
in classAbstractSpringExpressionEvaluatorEx
- Parameters:
value
- value to return
-
apply
-
prepareContext
Pre-process the script context before execution.- Specified by:
prepareContext
in classAbstractSpringExpressionEvaluatorEx
- Parameters:
context
- the expression contextinput
- the inputs
-