public interface MustacheListener extends ConfigurationAware
Mustache processing.
Listeners are invoked in the order of their registration, except for
renderingFinished(MustacheRenderingEvent) method which is invoked in
reverse order.
Code inside a listener may throw an unchecked exception - this aborts further processing of the template and no more listeners are invoked afterwards.
Any listener may implement optional interface
Validateable. The validation is
performed before a MustacheEngine is built. An
invalid listener is not put into service, i.e. it's not included in the final
list of listeners returned by
Configuration.getMustacheListeners().
MustacheEngineBuilder.addMustacheListener(MustacheListener)| Modifier and Type | Method and Description |
|---|---|
void |
compilationFinished(MustacheCompilationEvent event)
Notification that a
Mustache template was just compiled. |
void |
parsingStarted(MustacheParsingEvent event)
Parsing of a
Mustache is about to start. |
void |
renderingFinished(MustacheRenderingEvent event)
Rendering of a
Mustache is about to finish. |
void |
renderingStarted(MustacheRenderingEvent event)
Rendering of a
Mustache is about to start. |
getConfigurationKeys, initvoid compilationFinished(MustacheCompilationEvent event)
Mustache template was just compiled. Keep in
mind that processing of a Lambda may also result in one-off
template compilation - see also
Lambda.isReturnValueInterpolated().event - void renderingStarted(MustacheRenderingEvent event)
Mustache is about to start. Always use
ReleaseCallbackContainer.registerReleaseCallback(ReleaseCallback)
to release all the necessary resources.event - void renderingFinished(MustacheRenderingEvent event)
Mustache is about to finish. Always use
ReleaseCallbackContainer.registerReleaseCallback(ReleaseCallback)
to release all the necessary resources.event - void parsingStarted(MustacheParsingEvent event)
Mustache is about to start. Listeners are allowed to
modify the event payload, particularly the Reader object used by
a parser to read the template contents.event - Copyright © 2014. All Rights Reserved.