Interface XTemplates.Formatter<T>

  • Type Parameters:
    T - the type of data the formatter is intended to handle
    Enclosing interface:
    XTemplates

    public static interface XTemplates.Formatter<T>
    A simple interface to facilitate creation of custom formatters. Instances should be created by a static factory method, as defined by XTemplates.FormatterFactories.
    • Method Detail

      • format

        String format​(T data)
        Formats the given data so it can be drawn in the template as a plain string.
        Parameters:
        data - the parameter passed in from the template. Will never be null unless XTemplates.FormatterFactory.acceptsNull() is true
        Returns:
        a string to render in the template