Package de.haumacher.msgbuf.generator
Class MessageGenerator
- java.lang.Object
-
- de.haumacher.msgbuf.generator.util.AbstractFileGenerator
-
- de.haumacher.msgbuf.generator.util.AbstractJavaGenerator
-
- de.haumacher.msgbuf.generator.AbstractMessageGenerator
-
- de.haumacher.msgbuf.generator.MessageGenerator
-
- All Implemented Interfaces:
Definition.Visitor<Void,Void>,FileGenerator
public class MessageGenerator extends AbstractMessageGenerator implements Definition.Visitor<Void,Void>
Generatorfor message data classes.
-
-
Field Summary
-
Fields inherited from class de.haumacher.msgbuf.generator.AbstractMessageGenerator
_noInterfaces, _packageSuffix
-
-
Constructor Summary
Constructors Constructor Description MessageGenerator(NameTable table, Map<String,Option> options, boolean isInterface, String packageSuffix, MessageDef def, GeneratorPlugin plugin)Creates aMessageGenerator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddocComment(String comment)protected voidgenerate()booleanisBinary()Whether binary IO should be generated.booleanisJson()Whether to generate JSON serialization code.booleanisReflection()Whether reflective access should be generated.voidsetBinary(boolean binary)voidsetJson(boolean json)voidsetReflection(boolean reflection)Voidvisit(EnumDef def, Void arg)Visit case forEnumDef.Voidvisit(MessageDef def, Void arg)Visit case forMessageDef.-
Methods inherited from class de.haumacher.msgbuf.generator.AbstractMessageGenerator
concreteSpecializations, getOptions, implName, isTrue, qImplName
-
-
-
-
Constructor Detail
-
MessageGenerator
public MessageGenerator(NameTable table, Map<String,Option> options, boolean isInterface, String packageSuffix, MessageDef def, GeneratorPlugin plugin)
Creates aMessageGenerator.- Parameters:
packageSuffix-
-
-
Method Detail
-
isJson
public boolean isJson()
Whether to generate JSON serialization code.
-
setJson
public void setJson(boolean json)
- See Also:
isJson()
-
isBinary
public boolean isBinary()
Whether binary IO should be generated.
-
setBinary
public void setBinary(boolean binary)
- See Also:
isBinary()
-
isReflection
public boolean isReflection()
Whether reflective access should be generated.
-
setReflection
public void setReflection(boolean reflection)
- See Also:
isReflection()
-
generate
protected void generate()
- Specified by:
generatein classAbstractFileGenerator
-
docComment
protected void docComment(String comment)
- Overrides:
docCommentin classAbstractJavaGenerator
-
visit
public Void visit(EnumDef def, Void arg)
Description copied from interface:Definition.VisitorVisit case forEnumDef.- Specified by:
visitin interfaceDefinition.Visitor<Void,Void>
-
visit
public Void visit(MessageDef def, Void arg)
Description copied from interface:Definition.VisitorVisit case forMessageDef.- Specified by:
visitin interfaceDefinition.Visitor<Void,Void>
-
-