Package net.shibboleth.ext.spring.util
Class AbstractSpringExpressionEvaluator<T,U>
- java.lang.Object
-
- net.shibboleth.ext.spring.util.AbstractSpringExpressionEvaluator<T,U>
-
- Type Parameters:
T- type of inputU- type of output
@Deprecated(forRemoval=true, since="6.1.0") public abstract class AbstractSpringExpressionEvaluator<T,U> extends Object
Deprecated, for removal: This API element is subject to removal in a future version.A component that evaluates a Spring EL expression against a set of inputs and returns the result.- Since:
- 5.4.0
-
-
Field Summary
Fields Modifier and Type Field Description private ObjectcustomObjectDeprecated, for removal: This API element is subject to removal in a future version.A custom object to inject into the expression context.private booleanhideExceptionsDeprecated, for removal: This API element is subject to removal in a future version.Whether to raise runtime exceptions if expression fails.private Class<T>inputTypeDeprecated, for removal: This API element is subject to removal in a future version.The input type.private org.slf4j.LoggerlogDeprecated, for removal: This API element is subject to removal in a future version.Class logger.private Class<U>outputTypeDeprecated, for removal: This API element is subject to removal in a future version.The output type.private UreturnOnErrorDeprecated, for removal: This API element is subject to removal in a future version.Value to return from predicate when an error occurs.private StringspringExpressionDeprecated, for removal: This API element is subject to removal in a future version.SpEL expression to evaluate.
-
Constructor Summary
Constructors Constructor Description AbstractSpringExpressionEvaluator(String expression)Deprecated, for removal: This API element is subject to removal in a future version.Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected Uevaluate(T input)Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the Spring expression on the provided input.ObjectgetCustomObject()Deprecated, for removal: This API element is subject to removal in a future version.Get the custom (externally provided) object.Class<T>getInputType()Deprecated, for removal: This API element is subject to removal in a future version.Get the input type to be enforced.protected Class<U>getOutputType()Deprecated, for removal: This API element is subject to removal in a future version.Get the output type to be enforced.protected voidprepareContext(EvaluationContext context, T input)Deprecated, for removal: This API element is subject to removal in a future version.Decorate the expression context with any additional content.voidsetCustomObject(Object object)Deprecated, for removal: This API element is subject to removal in a future version.Set a custom (externally provided) object.voidsetHideExceptions(boolean flag)Deprecated, for removal: This API element is subject to removal in a future version.Set whether to hide exceptions in expression execution (default is false).voidsetInputType(Class<T> type)Deprecated, for removal: This API element is subject to removal in a future version.Set the input type to be enforced.voidsetOutputType(Class<U> type)Deprecated, for removal: This API element is subject to removal in a future version.Set the output type to be enforced.voidsetReturnOnError(U what)Deprecated, for removal: This API element is subject to removal in a future version.Set value to return if an error occurs (default is false).
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Deprecated, for removal: This API element is subject to removal in a future version.Class logger.
-
springExpression
@Nullable private String springExpression
Deprecated, for removal: This API element is subject to removal in a future version.SpEL expression to evaluate.
-
customObject
@Nullable private Object customObject
Deprecated, for removal: This API element is subject to removal in a future version.A custom object to inject into the expression context.
-
outputType
@Nullable private Class<U> outputType
Deprecated, for removal: This API element is subject to removal in a future version.The output type.
-
inputType
@Nullable private Class<T> inputType
Deprecated, for removal: This API element is subject to removal in a future version.The input type.
-
hideExceptions
private boolean hideExceptions
Deprecated, for removal: This API element is subject to removal in a future version.Whether to raise runtime exceptions if expression fails.
-
returnOnError
@Nullable private U returnOnError
Deprecated, for removal: This API element is subject to removal in a future version.Value to return from predicate when an error occurs.
-
-
Constructor Detail
-
AbstractSpringExpressionEvaluator
public AbstractSpringExpressionEvaluator(@Nonnull @NotEmpty @ParameterName(name="expression") String expression)
Deprecated, for removal: This API element is subject to removal in a future version.Constructor.- Parameters:
expression- the expression to evaluate
-
-
Method Detail
-
setOutputType
public void setOutputType(@Nullable Class<U> type)Deprecated, for removal: This API element is subject to removal in a future version.Set the output type to be enforced.- Parameters:
type- output type
-
getOutputType
@Nullable protected Class<U> getOutputType()
Deprecated, for removal: This API element is subject to removal in a future version.Get the output type to be enforced.- Returns:
- output type
-
getInputType
@Nullable public Class<T> getInputType()
Deprecated, for removal: This API element is subject to removal in a future version.Get the input type to be enforced.- Returns:
- input type
-
setInputType
public void setInputType(@Nullable Class<T> type)Deprecated, for removal: This API element is subject to removal in a future version.Set the input type to be enforced.- Parameters:
type- input type
-
setCustomObject
public void setCustomObject(@Nullable Object object)Deprecated, for removal: This API element is subject to removal in a future version.Set a custom (externally provided) object.- Parameters:
object- the custom object
-
getCustomObject
public Object getCustomObject()
Deprecated, for removal: This API element is subject to removal in a future version.Get the custom (externally provided) object.- Returns:
- the custom object
-
setHideExceptions
public void setHideExceptions(boolean flag)
Deprecated, for removal: This API element is subject to removal in a future version.Set whether to hide exceptions in expression execution (default is false).- Parameters:
flag- flag to set
-
setReturnOnError
public void setReturnOnError(U what)
Deprecated, for removal: This API element is subject to removal in a future version.Set value to return if an error occurs (default is false).- Parameters:
what- value to set
-
evaluate
protected U evaluate(@Nullable T input)
Deprecated, for removal: This API element is subject to removal in a future version.Evaluate the Spring expression on the provided input.- Parameters:
input- input over which to evaluate the expression- Returns:
- result of applying the expression to the provided input
-
prepareContext
protected void prepareContext(@Nonnull EvaluationContext context, @Nullable T input)Deprecated, for removal: This API element is subject to removal in a future version.Decorate the expression context with any additional content.- Parameters:
context- expression contextinput- to predicate
-
-