Interface ResultMapper

All Superinterfaces:
WithPriority
All Known Implementing Classes:
HtmlEscaper
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ResultMapper extends WithPriority
This component can be used to map a result of an evaluated value expression to a string value.

The first result mapper that applies to the result object is used. The mapper with higher priority wins.

See Also:
  • Method Details

    • appliesTo

      default boolean appliesTo(TemplateNode.Origin origin, Object result)
      Parameters:
      origin -
      result -
      Returns:
      true if this mapper applies to the given result
    • map

      String map(Object result, Expression expression)
      Parameters:
      result -
      expression - The original expression
      Returns:
      the string value