Class AbstractFileGenerator
- java.lang.Object
-
- de.haumacher.msgbuf.generator.util.AbstractFileGenerator
-
- All Implemented Interfaces:
FileGenerator
- Direct Known Subclasses:
AbstractDartGenerator,AbstractJavaGenerator
public abstract class AbstractFileGenerator extends Object implements FileGenerator
Base class for code generators.
-
-
Constructor Summary
Constructors Constructor Description AbstractFileGenerator()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidappend(String part)protected abstract voiddocComment(String comment)protected abstract voidgenerate()voidgenerate(Appendable out, int indent)Generates the file contents to the givenAppendable.intgetIndent()The current indentation level.protected voidinclude(FileGenerator other)protected voidline(String line)protected voidline(String... parts)protected voidlineStart(String line)protected voidnl()
-
-
-
Method Detail
-
generate
public void generate(Appendable out, int indent)
Description copied from interface:FileGeneratorGenerates the file contents to the givenAppendable.- Specified by:
generatein interfaceFileGeneratorindent- The initial indentation level to start with.
-
include
protected void include(FileGenerator other)
-
getIndent
public int getIndent()
The current indentation level.
-
generate
protected abstract void generate()
-
docComment
protected abstract void docComment(String comment)
-
line
protected void line(String line)
-
line
protected void line(String... parts)
-
lineStart
protected void lineStart(String line)
-
append
protected void append(String part)
-
nl
protected void nl()
-
-