Package com.fizzed.rocker.model
Interface TemplateModelPostProcessor
-
- All Known Implementing Classes:
LoggingProcessor,WhitespaceRemovalProcessor
public interface TemplateModelPostProcessorClasses implementing theTemplateModelPostProcessorinterface can be used as post-processors ofTemplateModels. To activate such post-processing, Rocker templates must be provided with the "postProcessing" option (@seeRockerOptions.POST_PROCESSING), containing a comma-separated list of class names implementing this interface. TheJavaGeneratorthen calls each given post-processor with theTemplateModelas argument immediately before the resulting template Java code is created.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TemplateModelprocess(TemplateModel templateModel, int ppIndex)Performs any post-processing on the givenTemplateModelas defined by the implementing class.
-
-
-
Method Detail
-
process
TemplateModel process(TemplateModel templateModel, int ppIndex) throws PostProcessorException
Performs any post-processing on the givenTemplateModelas defined by the implementing class. Only the returned instance shall be used further by the caller. Implementing classes may choose to return the provided instance, or create a completely new instance for further processing.- Parameters:
templateModel- the original template model (which might have already been processed by previousTemplateModelPostProcessors.ppIndex- the index (starting from 0) of the post-processor as it appears in the list of given post-processor class names.- Returns:
- the resulting
TemplateModelwhich shall be used for further processing by following post-processors, or finally by theJavaGenerator. - Throws:
PostProcessorException
-
-