Class HandlebarsHelper<T>
- java.lang.Object
-
- com.github.tomakehurst.wiremock.extension.responsetemplating.helpers.HandlebarsHelper<T>
-
- Type Parameters:
T
- Type used as context for the Handlebars helper.
- All Implemented Interfaces:
com.github.jknack.handlebars.Helper<T>
- Direct Known Subclasses:
ArrayHelper
,ContainsHelper
,FormDataHelper
,HandlebarsCurrentDateHelper
,HandlebarsJsonPathHelper
,HandlebarsRandomValuesHelper
,HandlebarsXPathHelper
,HostnameHelper
,MatchesRegexHelper
,MathsHelper
,ParseDateHelper
,ParseJsonHelper
,PickRandomHelper
,RandomDecimalHelper
,RandomIntHelper
,RangeHelper
,RegexExtractHelper
,SizeHelper
,SystemValueHelper
,TruncateDateTimeHelper
public abstract class HandlebarsHelper<T> extends java.lang.Object implements com.github.jknack.handlebars.Helper<T>
This abstract class is the base for all defined Handlebars helper in wiremock. It basically allows simpler error handling.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ERROR_PREFIX
static java.lang.String
ERROR_SUFFIX
-
Constructor Summary
Constructors Constructor Description HandlebarsHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static RenderCache
getRenderCache(com.github.jknack.handlebars.Options options)
protected java.lang.String
handleError(java.lang.String message)
Handle invalid helper data without exception details or because none was thrown.protected java.lang.String
handleError(java.lang.String message, java.lang.String logExclusive, java.lang.Throwable cause)
Handle invalid helper data with exception details in the log message.protected java.lang.String
handleError(java.lang.String message, java.lang.Throwable cause)
Handle invalid helper data with exception details in the log message.
-
-
-
Field Detail
-
ERROR_PREFIX
public static final java.lang.String ERROR_PREFIX
- See Also:
- Constant Field Values
-
ERROR_SUFFIX
public static final java.lang.String ERROR_SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
handleError
protected java.lang.String handleError(java.lang.String message)
Handle invalid helper data without exception details or because none was thrown.- Parameters:
message
- message to log and return- Returns:
- a message which will be used as content
-
handleError
protected java.lang.String handleError(java.lang.String message, java.lang.Throwable cause)
Handle invalid helper data with exception details in the log message.- Parameters:
message
- message to log and returncause
- which occurred during application of the helper- Returns:
- a message which will be used as content
-
handleError
protected java.lang.String handleError(java.lang.String message, java.lang.String logExclusive, java.lang.Throwable cause)
Handle invalid helper data with exception details in the log message. Also additional information regarding the issue is written in the logs.- Parameters:
message
- message to log and returnlogExclusive
- additional information just for the logcause
- which occured during application of the helper- Returns:
- a message which will be used as content
-
getRenderCache
protected static RenderCache getRenderCache(com.github.jknack.handlebars.Options options)
-
-