Class Part
- 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
-
- All Implemented Interfaces:
DataObject,ReflectiveDataObject,Observable
public abstract class Part extends DefinitionBase
Member of aDefinition.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePart.Visitor<R,A>Visitor interface for theParthierarchy.-
Nested classes/interfaces inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
WithOptions.TypeKind
-
-
Field Summary
Fields Modifier and Type Field Description static StringINDEX__PROPstatic StringNAME__PROPstatic StringOWNER__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 Abstract Methods Concrete Methods Modifier and Type Method Description Objectget(String field)intgetIndex()The numeric identifier for this member.StringgetName()The name of this member.DefinitiongetOwner()TheDefinitiondefinint thisPart.booleanhasOwner()Checks, whethergetOwner()has a value.protected voidinternalSetIndex(int value)Internal setter forgetIndex()without chain call utility.protected voidinternalSetName(String value)Internal setter forgetName()without chain call utility.protected voidinternalSetOwner(Definition value)Internal setter forgetOwner()without chain call utility.List<String>properties()PartputOption(String key, Option value)Adds a key value pair to theWithOptions.getOptions()map.protected voidreadField(JsonReader in, String field)static PartreadPart(JsonReader in)Reads a new instance from the given reader.voidset(String field, Object value)PartsetComment(String value)PartsetIndex(int value)PartsetName(String value)PartsetOptions(Map<String,Option> value)PartsetOwner(Definition value)<R,A>
Rvisit(DefinitionBase.Visitor<R,A> v, A arg)Accepts the given visitor.abstract <R,A>
Rvisit(Part.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, visit
-
Methods inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
getOptions, internalPutOption, internalRegisterListener, internalSetOptions, internalUnregisterListener, kind, 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
jsonType, transientProperties
-
-
-
-
Field Detail
-
NAME__PROP
public static final String NAME__PROP
- See Also:
getName(), Constant Field Values
-
INDEX__PROP
public static final String INDEX__PROP
- See Also:
getIndex(), Constant Field Values
-
OWNER__PROP
public static final String OWNER__PROP
- See Also:
getOwner(), Constant Field Values
-
-
Constructor Detail
-
Part
protected Part()
Creates aPartinstance.
-
-
Method Detail
-
getName
public final String getName()
The name of this member.
-
internalSetName
protected final void internalSetName(String value)
Internal setter forgetName()without chain call utility.
-
getIndex
public final int getIndex()
The numeric identifier for this member.
-
setIndex
public Part setIndex(int value)
- See Also:
getIndex()
-
internalSetIndex
protected final void internalSetIndex(int value)
Internal setter forgetIndex()without chain call utility.
-
getOwner
public final Definition getOwner()
TheDefinitiondefinint thisPart.
-
setOwner
public Part setOwner(Definition value)
- See Also:
getOwner()
-
internalSetOwner
protected final void internalSetOwner(Definition value)
Internal setter forgetOwner()without chain call utility.
-
hasOwner
public final boolean hasOwner()
Checks, whethergetOwner()has a value.
-
setComment
public Part setComment(String value)
- Overrides:
setCommentin classDefinitionBase- See Also:
DefinitionBase.getComment()
-
setOptions
public Part setOptions(Map<String,Option> value)
- Overrides:
setOptionsin classDefinitionBase- See Also:
WithOptions.getOptions()
-
putOption
public Part putOption(String key, Option value)
Description copied from class:WithOptionsAdds a key value pair to theWithOptions.getOptions()map.- Overrides:
putOptionin classDefinitionBase
-
properties
public List<String> properties()
- Specified by:
propertiesin interfaceReflectiveDataObject- Overrides:
propertiesin classDefinitionBase
-
get
public Object get(String field)
- Specified by:
getin interfaceReflectiveDataObject- Overrides:
getin classDefinitionBase
-
set
public void set(String field, Object value)
- Specified by:
setin interfaceReflectiveDataObject- Overrides:
setin classDefinitionBase
-
readPart
public static Part readPart(JsonReader in) throws IOException
Reads a new instance from the given reader.- Throws:
IOException
-
writeFields
protected void writeFields(JsonWriter out) throws IOException
- Overrides:
writeFieldsin classDefinitionBase- Throws:
IOException
-
readField
protected void readField(JsonReader in, String field) throws IOException
- Overrides:
readFieldin classDefinitionBase- Throws:
IOException
-
visit
public abstract <R,A> R visit(Part.Visitor<R,A> v, A arg)
Accepts the given visitor.
-
visit
public final <R,A> R visit(DefinitionBase.Visitor<R,A> v, A arg)
Description copied from class:DefinitionBaseAccepts the given visitor.- Specified by:
visitin classDefinitionBase
-
-