Class SpringExpressionPredicate<T>
java.lang.Object
net.shibboleth.shared.spring.expression.AbstractSpringExpressionEvaluator
net.shibboleth.shared.spring.expression.SpringExpressionPredicate<T>
- Type Parameters:
T- type of input
- All Implemented Interfaces:
Predicate<T>
public class SpringExpressionPredicate<T>
extends AbstractSpringExpressionEvaluator
implements Predicate<T>
Predicate whose condition is defined by an Spring EL expression.
- Since:
- 5.4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionInput type.private final org.slf4j.LoggerClass logger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the input type to be enforced.protected voidprepareContext(EvaluationContext context, Object... input) Pre-process the script context before execution.private booleanHelper function to sanity check return-on-error object.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).booleanMethods inherited from class net.shibboleth.shared.spring.expression.AbstractSpringExpressionEvaluator
evaluate, getCustomObject, getOutputType, getReturnOnError, setCustomObject, setHideExceptions, setOutputType, setReturnOnError
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
inputTypeClass
Input type.
-
-
Constructor Details
-
SpringExpressionPredicate
public SpringExpressionPredicate(@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
- Since:
- 6.1.0
-
setInputType
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
-
test
-
returnError
Helper function to sanity check return-on-error object.- Returns:
- a boolean-valued error fallback
- Throws:
ClassCastException- if the installed fallback is null or non-Boolean
-
prepareContext
Pre-process the script context before execution.- Specified by:
prepareContextin classAbstractSpringExpressionEvaluator- Parameters:
context- the expression contextinput- the inputs
-