Interface FreemarkerView.MustConsume

Enclosing class:
FreemarkerView

public static interface FreemarkerView.MustConsume
Marker for an attribute value that promises to be adopted during the render (unwrapped from the data model by some directive and applied to render-scoped state), and wants the render to fail if that never happens instead of silently behaving as if the attribute was absent.

FreemarkerViewRenderer checks every attribute value after a successful Template.process(...): any value implementing this interface whose consumed() is still false fails the render with notConsumedMessage(String).

  • Method Details

    • consumed

      boolean consumed()
      Returns:
      Whether this attribute was adopted during the render.
    • notConsumedMessage

      Parameters:
      templateName - The template that was rendered.
      Returns:
      The message to raise when consumed() is still false after the render.