Class HandlebarsHelperRegistrationUtils

java.lang.Object
org.onehippo.forge.templating.support.handlebars.util.HandlebarsHelperRegistrationUtils

public class HandlebarsHelperRegistrationUtils extends Object
Utility to register helper functions.
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.github.jknack.handlebars.Handlebars
    registerHelpers(com.github.jknack.handlebars.Handlebars handlebars, String prefix, Class<?> helperClazz, Object helperSource)
    Register all the declared methods of helperClazz as helpers with prefixing the helper names by prefix if a non-null string is provided.
    static com.github.jknack.handlebars.Handlebars
    registerHelpers(com.github.jknack.handlebars.Handlebars handlebars, String prefix, Object helperSource)
    Register all the declared methods of helperClazz as helpers with prefixing the helper names by prefix if a non-null string is provided.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • registerHelpers

      public static com.github.jknack.handlebars.Handlebars registerHelpers(com.github.jknack.handlebars.Handlebars handlebars, String prefix, Object helperSource)
      Register all the declared methods of helperClazz as helpers with prefixing the helper names by prefix if a non-null string is provided.
      Parameters:
      handlebars - handlebars
      prefix - prefix
      helperSource - helperSource
      Returns:
      handlebars
    • registerHelpers

      public static com.github.jknack.handlebars.Handlebars registerHelpers(com.github.jknack.handlebars.Handlebars handlebars, String prefix, Class<?> helperClazz, Object helperSource)
      Register all the declared methods of helperClazz as helpers with prefixing the helper names by prefix if a non-null string is provided.
      Parameters:
      handlebars - handlebars
      prefix - prefix
      helperClazz - helperClazz
      helperSource - helperSource
      Returns:
      handlebars