Class WithStatementConsumerGenerator


  • public class WithStatementConsumerGenerator
    extends java.lang.Object
    We use this class to generate a withblock consumer while generating the template. Since we allow 1 or more with assignments, we cannot rely on a static consumer anymore. The JavaParser gathers the relevant WithBlocks it comes across, and at the end of the template we generate the relevant consumers using this helper class.
    • Field Detail

      • WITH_BLOCKS_GENERATED_CLASS_NAME

        protected static final java.lang.String WITH_BLOCKS_GENERATED_CLASS_NAME
        See Also:
        Constant Field Values
      • withStatementsTypeCounts

        private final java.util.Set<java.lang.Integer> withStatementsTypeCounts
    • Constructor Detail

      • WithStatementConsumerGenerator

        public WithStatementConsumerGenerator()
    • Method Detail

      • register

        public java.lang.String register​(WithStatement statement)
      • generate

        public void generate​(JavaGenerator generator,
                             java.io.Writer w)
                      throws java.io.IOException
        Throws:
        java.io.IOException