Class SpringExpressionFunction<T,U>

java.lang.Object
net.shibboleth.ext.spring.util.AbstractSpringExpressionEvaluatorEx
net.shibboleth.ext.spring.util.SpringExpressionFunction<T,U>
Type Parameters:
T - type of input
U - type of output
All Implemented Interfaces:
Function<T,U>

public class SpringExpressionFunction<T,U> extends AbstractSpringExpressionEvaluatorEx implements Function<T,U>
Function whose output is defined by an Spring EL expression.
Since:
5.4.0
  • Field Details

    • log

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

      @Nullable private Class<T> inputType
      The input type.
  • Constructor Details

    • SpringExpressionFunction

      public SpringExpressionFunction(@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
    • setInputType

      public void setInputType(@Nullable Class<T> type)
      Set the input type to be enforced.
      Parameters:
      type - input type
    • setOutputType

      public void setOutputType(@Nullable Class<?> type)
      Set the output type to be enforced.
      Overrides:
      setOutputType in class AbstractSpringExpressionEvaluatorEx
      Parameters:
      type - output type
    • setReturnOnError

      public void setReturnOnError(@Nullable Object value)
      Set value to return if an error occurs.
      Overrides:
      setReturnOnError in class AbstractSpringExpressionEvaluatorEx
      Parameters:
      value - value to return
    • apply

      public U apply(@Nullable T input)
      Specified by:
      apply in interface Function<T,U>
    • prepareContext

      protected void prepareContext(@Nonnull EvaluationContext context, @Nullable Object... input)
      Pre-process the script context before execution.
      Specified by:
      prepareContext in class AbstractSpringExpressionEvaluatorEx
      Parameters:
      context - the expression context
      input - the inputs