Package com.fizzed.rocker.compiler
Class WithStatementConsumerGenerator
- java.lang.Object
-
- com.fizzed.rocker.compiler.WithStatementConsumerGenerator
-
public class WithStatementConsumerGenerator extends java.lang.ObjectWe 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 Summary
Fields Modifier and Type Field Description protected static java.lang.StringWITH_BLOCKS_GENERATED_CLASS_NAMEprivate java.util.Set<java.lang.Integer>withStatementsTypeCounts
-
Constructor Summary
Constructors Constructor Description WithStatementConsumerGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerate(JavaGenerator generator, java.io.Writer w)java.lang.Stringregister(WithStatement statement)
-
-
-
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
-
-
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
-
-