Class Constant
- 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.Part
-
- de.haumacher.msgbuf.generator.ast.Constant
-
- All Implemented Interfaces:
DataObject,ReflectiveDataObject,Observable
public class Constant extends Part
A constant of anEnumDef.- See Also:
EnumDef.getConstants()
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.haumacher.msgbuf.generator.ast.Part
Part.Visitor<R,A>
-
Nested classes/interfaces inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
WithOptions.TypeKind
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONSTANT__TYPEIdentifier for theConstanttype in JSON format.-
Fields inherited from class de.haumacher.msgbuf.generator.ast.Part
INDEX__PROP, NAME__PROP, OWNER__PROP
-
Fields inherited from class de.haumacher.msgbuf.generator.ast.DefinitionBase
COMMENT__PROP
-
Fields inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
_listener, OPTIONS__PROP
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Constantcreate()Creates aConstantinstance.StringjsonType()WithOptions.TypeKindkind()The type code of this instance.ConstantputOption(String key, Option value)Adds a key value pair to theWithOptions.getOptions()map.static ConstantreadConstant(JsonReader in)Reads a new instance from the given reader.ConstantsetComment(String value)ConstantsetIndex(int value)ConstantsetName(String value)ConstantsetOptions(Map<String,Option> value)ConstantsetOwner(Definition value)<R,A>
Rvisit(Part.Visitor<R,A> v, A arg)Accepts the given visitor.-
Methods inherited from class de.haumacher.msgbuf.generator.ast.Part
get, getIndex, getName, getOwner, hasOwner, internalSetIndex, internalSetName, internalSetOwner, properties, readField, readPart, set, visit, writeFields
-
Methods inherited from class de.haumacher.msgbuf.generator.ast.DefinitionBase
getComment, internalSetComment, readDefinitionBase, visit
-
Methods inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
getOptions, internalPutOption, internalRegisterListener, internalSetOptions, internalUnregisterListener, readWithOptions, registerListener, removeOption, unregisterListener, writeTo
-
Methods inherited from class de.haumacher.msgbuf.data.AbstractDataObject
readContent, readFields, toString, writeContent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.haumacher.msgbuf.data.ReflectiveDataObject
transientProperties
-
-
-
-
Field Detail
-
CONSTANT__TYPE
public static final String CONSTANT__TYPE
Identifier for theConstanttype in JSON format.- See Also:
- Constant Field Values
-
-
Method Detail
-
kind
public WithOptions.TypeKind kind()
Description copied from class:WithOptionsThe type code of this instance.- Specified by:
kindin classWithOptions
-
setName
public Constant setName(String value)
- Overrides:
setNamein classPart- See Also:
Part.getName()
-
setIndex
public Constant setIndex(int value)
- Overrides:
setIndexin classPart- See Also:
Part.getIndex()
-
setOwner
public Constant setOwner(Definition value)
- Overrides:
setOwnerin classPart- See Also:
Part.getOwner()
-
setComment
public Constant setComment(String value)
- Overrides:
setCommentin classPart- See Also:
DefinitionBase.getComment()
-
setOptions
public Constant setOptions(Map<String,Option> value)
- Overrides:
setOptionsin classPart- See Also:
WithOptions.getOptions()
-
putOption
public Constant putOption(String key, Option value)
Description copied from class:WithOptionsAdds a key value pair to theWithOptions.getOptions()map.
-
jsonType
public String jsonType()
-
readConstant
public static Constant readConstant(JsonReader in) throws IOException
Reads a new instance from the given reader.- Throws:
IOException
-
visit
public <R,A> R visit(Part.Visitor<R,A> v, A arg)
Description copied from class:PartAccepts the given visitor.
-
-