Class JavaGenerator


  • public class JavaGenerator
    extends java.lang.Object
    • Method Detail

      • setPlainTextStrategy

        public void setPlainTextStrategy​(PlainTextStrategy plainTextStrategy)
      • tab

        public java.io.Writer tab​(java.io.Writer w,
                                  int count)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • sourceRef

        public java.lang.String sourceRef​(TemplateUnit unit)
      • sourceRefLineCommaPosInLine

        public java.lang.String sourceRefLineCommaPosInLine​(TemplateUnit unit)
      • appendCommentAndSourcePositionUpdate

        public void appendCommentAndSourcePositionUpdate​(java.io.Writer w,
                                                         int tab,
                                                         TemplateUnit unit)
                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • isForIteratorType

        public boolean isForIteratorType​(java.lang.String type)
      • appendArgumentMembers

        public void appendArgumentMembers​(TemplateModel model,
                                          java.io.Writer w,
                                          java.lang.String access,
                                          boolean finalModifier,
                                          int indent)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • postProcess

        private TemplateModel postProcess​(TemplateModel templateModel)
                                   throws PostProcessorException
        Execute all TemplateModelPostProcessors 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 - the TemplateModel to run the post-processing on.
        Returns:
        a TemplateModel with 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.