Class DefinitionBase
- java.lang.Object
-
- de.haumacher.msgbuf.data.AbstractDataObject
-
- de.haumacher.msgbuf.generator.ast.WithOptions
-
- de.haumacher.msgbuf.generator.ast.DefinitionBase
-
- All Implemented Interfaces:
DataObject,ReflectiveDataObject,Observable
- Direct Known Subclasses:
Definition,Part
public abstract class DefinitionBase extends WithOptions
Base class for type and field definitions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceDefinitionBase.Visitor<R,A>Visitor interface for theDefinitionBasehierarchy.-
Nested classes/interfaces inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
WithOptions.TypeKind
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMMENT__PROP-
Fields inherited from class de.haumacher.msgbuf.generator.ast.WithOptions
_listener, OPTIONS__PROP
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefinitionBase()Creates aDefinitionBaseinstance.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Objectget(String field)StringgetComment()The documentation comment for this definition.protected voidinternalSetComment(String value)Internal setter forgetComment()without chain call utility.List<String>properties()DefinitionBaseputOption(String key, Option value)Adds a key value pair to theWithOptions.getOptions()map.static DefinitionBasereadDefinitionBase(JsonReader in)Reads a new instance from the given reader.protected voidreadField(JsonReader in, String field)voidset(String field, Object value)DefinitionBasesetComment(String value)DefinitionBasesetOptions(Map<String,Option> value)abstract <R,A>
Rvisit(DefinitionBase.Visitor<R,A> v, A arg)Accepts the given visitor.<R,A>
Rvisit(WithOptions.Visitor<R,A> v, A arg)Accepts the given visitor.protected voidwriteFields(JsonWriter out)-
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
-
COMMENT__PROP
public static final String COMMENT__PROP
- See Also:
getComment(), Constant Field Values
-
-
Constructor Detail
-
DefinitionBase
protected DefinitionBase()
Creates aDefinitionBaseinstance.
-
-
Method Detail
-
getComment
public final String getComment()
The documentation comment for this definition.
-
setComment
public DefinitionBase setComment(String value)
- See Also:
getComment()
-
internalSetComment
protected final void internalSetComment(String value)
Internal setter forgetComment()without chain call utility.
-
setOptions
public DefinitionBase setOptions(Map<String,Option> value)
- Overrides:
setOptionsin classWithOptions- See Also:
WithOptions.getOptions()
-
putOption
public DefinitionBase putOption(String key, Option value)
Description copied from class:WithOptionsAdds a key value pair to theWithOptions.getOptions()map.- Overrides:
putOptionin classWithOptions
-
properties
public List<String> properties()
- Specified by:
propertiesin interfaceReflectiveDataObject- Overrides:
propertiesin classWithOptions
-
get
public Object get(String field)
- Specified by:
getin interfaceReflectiveDataObject- Overrides:
getin classWithOptions
-
set
public void set(String field, Object value)
- Specified by:
setin interfaceReflectiveDataObject- Overrides:
setin classWithOptions
-
readDefinitionBase
public static DefinitionBase readDefinitionBase(JsonReader in) throws IOException
Reads a new instance from the given reader.- Throws:
IOException
-
writeFields
protected void writeFields(JsonWriter out) throws IOException
- Overrides:
writeFieldsin classWithOptions- Throws:
IOException
-
readField
protected void readField(JsonReader in, String field) throws IOException
- Overrides:
readFieldin classWithOptions- Throws:
IOException
-
visit
public abstract <R,A> R visit(DefinitionBase.Visitor<R,A> v, A arg)
Accepts the given visitor.
-
visit
public final <R,A> R visit(WithOptions.Visitor<R,A> v, A arg)
Description copied from class:WithOptionsAccepts the given visitor.- Specified by:
visitin classWithOptions
-
-