Package com.trafficparrot.sdk.handlebars
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringblockHelperErrorMessage(String name, String message) protected abstract Objectprotected StringerrorMessage(String message) errorMessageMap(com.github.jknack.handlebars.Context context, String message) getName()static StringinlineHelperMessage(String name, String message) protected booleanstatic voidsetThrowErrors(boolean throwErrors) protected static booleanWhether a helper error fails the request (trafficparrot.virtualservice.handlebars.throwErrors).
-
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 escapingdoApply(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
- Specified by:
applyin interfacecom.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
-
errorMessage
-
errorMessageMap
-
blockHelperErrorMessage
-
inlineHelperMessage
-