Package net.shibboleth.ext.spring.util
Class SpringExpressionPredicate<T>
- java.lang.Object
-
- net.shibboleth.ext.spring.util.AbstractSpringExpressionEvaluatorEx
-
- net.shibboleth.ext.spring.util.SpringExpressionPredicate<T>
-
- Type Parameters:
T- type of input
public class SpringExpressionPredicate<T> extends AbstractSpringExpressionEvaluatorEx implements Predicate<T>
Predicate whose condition is defined by an Spring EL expression.- Since:
- 5.4.0
-
-
Field Summary
Fields Modifier and Type Field Description private Class<T>inputTypeClassInput type.private org.slf4j.LoggerlogClass logger.
-
Constructor Summary
Constructors Constructor Description SpringExpressionPredicate(String expression)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.voidsetReturnOnError(boolean flag)Set value to return if an error occurs (default is false).booleantest(T input)-
Methods inherited from class net.shibboleth.ext.spring.util.AbstractSpringExpressionEvaluatorEx
evaluate, getCustomObject, getOutputType, getReturnOnError, setCustomObject, setHideExceptions, setOutputType, setReturnOnError
-
-
-
-
Constructor Detail
-
SpringExpressionPredicate
public SpringExpressionPredicate(@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
- Since:
- 6.1.0
-
setInputType
public void setInputType(@Nullable Class<T> type)Set the input type to be enforced.- Parameters:
type- input type- Since:
- 6.1.0
-
setReturnOnError
public void setReturnOnError(boolean flag)
Set value to return if an error occurs (default is false).- Parameters:
flag- flag to set
-
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
-
-