Class Definition
java.lang.Object
de.haumacher.msgbuf.data.AbstractDataObject
de.haumacher.msgbuf.generator.ast.WithOptions
de.haumacher.msgbuf.generator.ast.DefinitionBase
de.haumacher.msgbuf.generator.ast.Definition
- All Implemented Interfaces:
DataObject,ReflectiveDataObject,Observable
- Direct Known Subclasses:
EnumDef,MessageDef
Base class of a definition in a
DefinitionFile.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceVisitor interface for theDefinitionhierarchy.Nested classes/interfaces inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
WithOptions.TypeKind -
Field Summary
FieldsFields inherited from class de.haumacher.msgbuf.generator.ast.DefinitionBase
COMMENT__PROPFields inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
_listener, OPTIONS__PROP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal DefinitionFilegetFile()Reference back to theDefinitionFilethat contains this definition.final StringgetName()The name of this definition.final MessageDefgetOuter()TheMessageDefthat contains this inner .final booleanhasFile()Checks, whethergetFile()has a value.final booleanhasOuter()Checks, whethergetOuter()has a value.protected final voidinternalSetFile(DefinitionFile value) Internal setter forgetFile()without chain call utility.protected final voidinternalSetName(String value) Internal setter forgetName()without chain call utility.protected final voidinternalSetOuter(MessageDef value) Internal setter forgetOuter()without chain call utility.Adds a key value pair to theWithOptions.getOptions()map.static DefinitionReads a new instance from the given reader.protected voidreadField(JsonReader in, String field) voidsetComment(String value) setFile(DefinitionFile value) setOptions(Map<String, Option> value) setOuter(MessageDef value) abstract <R,A> R visit(Definition.Visitor<R, A> v, A arg) Accepts the given visitor.final <R,A> R visit(DefinitionBase.Visitor<R, A> v, A arg) Accepts the given visitor.protected voidwriteFields(JsonWriter out) Methods inherited from class de.haumacher.msgbuf.generator.ast.DefinitionBase
getComment, internalSetComment, readDefinitionBase, visitMethods inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
getOptions, internalPutOption, internalRegisterListener, internalSetOptions, internalUnregisterListener, kind, readWithOptions, registerListener, removeOption, unregisterListener, writeToMethods inherited from class de.haumacher.msgbuf.data.AbstractDataObject
readContent, readFields, toString, writeContentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface de.haumacher.msgbuf.data.ReflectiveDataObject
jsonType
-
Field Details
-
NAME__PROP
- See Also:
-
FILE__PROP
- See Also:
-
OUTER__PROP
- See Also:
-
-
Constructor Details
-
Definition
protected Definition()Creates aDefinitioninstance.
-
-
Method Details
-
getName
The name of this definition. -
setName
- See Also:
-
internalSetName
Internal setter forgetName()without chain call utility. -
getFile
Reference back to theDefinitionFilethat contains this definition. -
setFile
- See Also:
-
internalSetFile
Internal setter forgetFile()without chain call utility. -
hasFile
public final boolean hasFile()Checks, whethergetFile()has a value. -
getOuter
TheMessageDefthat contains this inner .The value is
nullfor top-level defintions, seegetFile(). -
setOuter
- See Also:
-
internalSetOuter
Internal setter forgetOuter()without chain call utility. -
hasOuter
public final boolean hasOuter()Checks, whethergetOuter()has a value. -
setComment
- Overrides:
setCommentin classDefinitionBase- See Also:
-
setOptions
- Overrides:
setOptionsin classDefinitionBase- See Also:
-
putOption
Description copied from class:WithOptionsAdds a key value pair to theWithOptions.getOptions()map.- Overrides:
putOptionin classDefinitionBase
-
properties
- Specified by:
propertiesin interfaceReflectiveDataObject- Overrides:
propertiesin classDefinitionBase
-
get
- Specified by:
getin interfaceReflectiveDataObject- Overrides:
getin classDefinitionBase
-
set
- Specified by:
setin interfaceReflectiveDataObject- Overrides:
setin classDefinitionBase
-
readDefinition
Reads a new instance from the given reader.- Throws:
IOException
-
writeFields
- Overrides:
writeFieldsin classDefinitionBase- Throws:
IOException
-
readField
- Overrides:
readFieldin classDefinitionBase- Throws:
IOException
-
visit
Accepts the given visitor. -
visit
Description copied from class:DefinitionBaseAccepts the given visitor.- Specified by:
visitin classDefinitionBase
-