Class PrecompileHelper

  • All Implemented Interfaces:
    Helper<java.lang.String>

    public final class PrecompileHelper
    extends java.lang.Object
    implements Helper<java.lang.String>
    Precompile a template to JavaScript using handlebars.js.
    Since:
    0.6.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Helper<java.lang.String> INSTANCE
      The default and shared instance.
      static java.lang.String NAME
      The default helper's name.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object apply​(java.lang.String path, Options options)
      Apply the helper to the context.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NAME

        public static final java.lang.String NAME
        The default helper's name.
        See Also:
        Constant Field Values
      • INSTANCE

        public static final Helper<java.lang.String> INSTANCE
        The default and shared instance.
    • Method Detail

      • apply

        public java.lang.Object apply​(java.lang.String path,
                                      Options options)
                               throws java.io.IOException
        Description copied from interface: Helper
        Apply the helper to the context.
        Specified by:
        apply in interface Helper<java.lang.String>
        Parameters:
        path - The context object.
        options - The options object.
        Returns:
        A string result.
        Throws:
        java.io.IOException - If a template cannot be loaded.