Class TrafficParrotHelper<T>

java.lang.Object
com.trafficparrot.sdk.handlebars.TrafficParrotHelper<T>
All Implemented Interfaces:
com.github.jknack.handlebars.Helper<T>

public abstract class TrafficParrotHelper<T> extends Object implements com.github.jknack.handlebars.Helper<T>
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
  • Constructor Details

    • TrafficParrotHelper

      protected TrafficParrotHelper()
  • Method Details

    • setThrowErrors

      public static void setThrowErrors(boolean throwErrors)
    • throwErrorsEnabled

      protected static boolean throwErrorsEnabled()
      Whether a helper error fails the request (trafficparrot.virtualservice.handlebars.throwErrors). Only an exception escaping doApply(T, com.github.jknack.handlebars.Options) reaches that check, so a helper that reports a failure without throwing reads this to decide whether to throw instead.
    • apply

      public Object apply(T parameter, com.github.jknack.handlebars.Options options) throws IOException
      Specified by:
      apply in interface com.github.jknack.handlebars.Helper<T>
      Throws:
      IOException
    • doApply

      protected abstract Object doApply(T parameter, com.github.jknack.handlebars.Options options) throws IOException
      Throws:
      IOException
    • isBlockHelper

      protected boolean isBlockHelper()
    • getName

      public String getName()
    • errorMessage

      protected String errorMessage(String message)
    • errorMessageMap

      protected Map<String,Object> errorMessageMap(com.github.jknack.handlebars.Context context, String message)
    • blockHelperErrorMessage

      public static String blockHelperErrorMessage(String name, String message)
    • inlineHelperMessage

      public static String inlineHelperMessage(String name, String message)