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 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static RenderCache
getRenderCache
(com.github.jknack.handlebars.Options options) protected String
handleError
(String message) Handle invalid helper data without exception details or because none was thrown.protected String
handleError
(String message, String logExclusive, Throwable cause) Handle invalid helper data with exception details in the log message.protected String
handleError
(String message, Throwable cause) Handle invalid helper data with exception details in the log message.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.github.jknack.handlebars.Helper
apply
-
Field Details
-
ERROR_PREFIX
- See Also:
-
ERROR_SUFFIX
- See Also:
-
-
Constructor Details
-
HandlebarsHelper
public HandlebarsHelper()
-
-
Method Details
-
handleError
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
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
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
-