T - type of inputU - type of outputpublic abstract class AbstractSpringExpressionEvaluator<T,U> extends Object
| Modifier and Type | Field and Description |
|---|---|
private Object |
customObject
A custom object to inject into the expression context.
|
private boolean |
hideExceptions
Whether to raise runtime exceptions if expression fails.
|
private Class<T> |
inputType
The input type.
|
private org.slf4j.Logger |
log
Class logger.
|
private Class<U> |
outputType
The output type.
|
private U |
returnOnError
Value to return from predicate when an error occurs.
|
private String |
springExpression
SpEL expression to evaluate.
|
| Constructor and Description |
|---|
AbstractSpringExpressionEvaluator(String expression)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected U |
evaluate(T input) |
Object |
getCustomObject()
Get the custom (externally provided) object.
|
Class<T> |
getInputType()
Get the input type to be enforced.
|
protected Class<U> |
getOutputType()
Get the output type to be enforced.
|
protected void |
prepareContext(org.springframework.expression.EvaluationContext context,
T input)
Decorate the expression context with any additional content.
|
void |
setCustomObject(Object object)
Set a custom (externally provided) object.
|
void |
setHideExceptions(boolean flag)
Set whether to hide exceptions in expression execution (default is false).
|
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(U what)
Set value to return if an error occurs (default is false).
|
@Nonnull private final org.slf4j.Logger log
@Nullable private Object customObject
private boolean hideExceptions
private U returnOnError
public AbstractSpringExpressionEvaluator(@Nonnull @NotEmpty @ParameterName(name="expression") String expression)
expression - the expression to evaluatepublic void setOutputType(@Nullable Class type)
type - output type@Nullable protected Class<U> getOutputType()
@Nullable public Class<T> getInputType()
public void setInputType(@Nullable Class<T> type)
type - input typepublic void setCustomObject(@Nullable Object object)
object - the custom objectpublic Object getCustomObject()
public void setHideExceptions(boolean flag)
flag - flag to setpublic void setReturnOnError(U what)
what - value to setCopyright © 1999–2019 Shibboleth Consortium. All rights reserved.