Package com.fizzed.rocker.compiler
Class JavaGenerator
java.lang.Object
com.fizzed.rocker.compiler.JavaGenerator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RockerConfigurationstatic final Stringprivate static final org.slf4j.Loggerstatic final intprivate PlainTextStrategystatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendArgumentMembers(TemplateModel model, Writer w, String access, boolean finalModifier, int indent) voidappendCommentAndSourcePositionUpdate(Writer w, int tab, TemplateUnit unit) private voidcreateSourceTemplate(TemplateModel model, Writer w) generate(TemplateModel model) booleanisForIteratorType(String type) private TemplateModelpostProcess(TemplateModel templateModel) Execute allTemplateModelPostProcessors as they were configured globally through Maven's pom.xml, and through a per-template option.voidsetPlainTextStrategy(PlainTextStrategy plainTextStrategy) sourceRef(TemplateUnit unit)
-
Field Details
-
log
private static final org.slf4j.Logger log -
CRLF
- See Also:
-
TAB
- See Also:
-
PLAIN_TEXT_CHUNK_LENGTH
public static final int PLAIN_TEXT_CHUNK_LENGTH- See Also:
-
configuration
-
plainTextStrategy
-
-
Constructor Details
-
JavaGenerator
-
-
Method Details
-
getConfiguration
-
getPlainTextStrategy
-
setPlainTextStrategy
-
generate
- Throws:
GeneratorExceptionIOException
-
tab
- Throws:
IOException
-
sourceRef
-
sourceRefLineCommaPosInLine
-
appendCommentAndSourcePositionUpdate
public void appendCommentAndSourcePositionUpdate(Writer w, int tab, TemplateUnit unit) throws IOException - Throws:
IOException
-
isForIteratorType
-
appendArgumentMembers
public void appendArgumentMembers(TemplateModel model, Writer w, String access, boolean finalModifier, int indent) throws IOException - Throws:
IOException
-
createSourceTemplate
private void createSourceTemplate(TemplateModel model, Writer w) throws GeneratorException, IOException - Throws:
GeneratorExceptionIOException
-
postProcess
Execute allTemplateModelPostProcessors as they were configured globally through Maven's pom.xml, and through a per-template option. If both were given, execute the global post-processors first, and then the per-template post-processors. Generation of Java code will continue with the TemplateModel returned by the last post-processor in the chain.- Parameters:
templateModel- theTemplateModelto run the post-processing on.- Returns:
- a
TemplateModelwith all post-processing transformations applied. Only this resulting TemplateModel will be used for further Java-code generation. - Throws:
PostProcessorException- if a post-processor cannot be instantiated, or if any of the post-processors throws an exception during processing of the model.
-