Package net.shibboleth.shared.spring.expression

# Class SpringExpressionConsumer<T>

java.lang.Object
net.shibboleth.shared.spring.expression.AbstractSpringExpressionEvaluator
net.shibboleth.shared.spring.expression.SpringExpressionConsumer<T>

Type Parameters:
  `T` - type of input

All Implemented Interfaces:
  `Consumer<T>`

public class SpringExpressionConsumer<T> extends AbstractSpringExpressionEvaluator implements Consumer<T>
Predicate whose condition is defined by an Spring EL expression.

Since:
  6.1.0

## Field Summary

Fields
Modifier and Type
Field
Description
`private Class<T>`
`inputTypeClass`
Input type.
`private final org.slf4j.Logger`
`log`
Class logger.

## Constructor Summary

Constructors
Constructor
Description
`SpringExpressionConsumer(String expression)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`accept(T input)`
`Class<T>`
`getInputType()`
Get the input type to be enforced.
`protected void`
`prepareContext(EvaluationContext context, Object... input)`
Pre-process the script context before execution.
`void`
`setInputType(Class<T> type)`
Set the input type to be enforced.

### Methods inherited from class net.shibboleth.shared.spring.expression.AbstractSpringExpressionEvaluator

`evaluate, getCustomObject, getOutputType, getReturnOnError, setCustomObject, setHideExceptions, setOutputType, setReturnOnError`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.function.Consumer

`andThen`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### inputTypeClass

@Nullable private Class<T> inputTypeClass
Input type.

## Constructor Details

### SpringExpressionConsumer

public SpringExpressionConsumer(@Nonnull @NotEmpty @ParameterName(name="expression") String expression)
Constructor.

Parameters:
  `expression` - the expression to evaluate

## Method Details

### 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

### accept

public void accept(@Nullable T input)

Specified by:
  `accept` in interface `Consumer<T>`

### prepareContext

protected void prepareContext(@Nonnull EvaluationContext context, @Nullable Object... input)
Pre-process the script context before execution.

Specified by:
  `prepareContext` in class `AbstractSpringExpressionEvaluator`
Parameters:
  `context` - the expression context
  `input` - the inputs