T - the specific type of contextpublic class SpringExpressionContextLookupFunction<T extends BaseContext> extends Object implements ContextDataLookupFunction<T,Object>
Function over a BaseContext which calls out to a Spring Expression.| Modifier and Type | Field and Description |
|---|---|
private Object |
customObject
A custom object that can be injected into the expression.
|
private boolean |
hideExceptions
Whether to raise runtime exceptions if an expression fails.
|
private Class<T> |
inputClass
What class we want the input to test against.
|
private org.slf4j.Logger |
log
Class logger.
|
private Class |
outputClass
What class we want the output to test against.
|
private String |
springExpression
SpEL expression to evaluate.
|
| Constructor and Description |
|---|
SpringExpressionContextLookupFunction(Class<T> inClass,
String expression)
Constructor.
|
SpringExpressionContextLookupFunction(Class<T> inClass,
String expression,
Class outputType)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
apply(T context) |
Object |
getCustomObject()
Return the custom (externally provided) object.
|
void |
setCustomObject(Object object)
Set the custom (externally provided) object.
|
void |
setHideExceptions(boolean flag)
Set whether to hide exceptions in expression execution (default is false).
|
@Nonnull private final org.slf4j.Logger log
@Nonnull private final Class<T extends BaseContext> inputClass
@Nullable private Object customObject
private boolean hideExceptions
public SpringExpressionContextLookupFunction(@Nonnull@ParameterName(name="inClass") Class<T> inClass, @Nonnull@NotEmpty@ParameterName(name="expression") String expression)
inClass - the class we accept as input.expression - the expression to evaluate.public SpringExpressionContextLookupFunction(@Nonnull@ParameterName(name="inClass") Class<T> inClass, @Nonnull@NotEmpty@ParameterName(name="expression") String expression, @ParameterName(name="outputType")@Nullable Class outputType)
inClass - the class we accept as input.expression - the expression to evaluate.outputType - the type to test against.@Nullable public Object getCustomObject()
@Nullable public void setCustomObject(Object object)
object - the custom objectpublic void setHideExceptions(boolean flag)
flag - flag to setCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.