Class WithOptions
- java.lang.Object
-
- de.haumacher.msgbuf.data.AbstractDataObject
-
- de.haumacher.msgbuf.generator.ast.WithOptions
-
- All Implemented Interfaces:
DataObject,ReflectiveDataObject,Observable
- Direct Known Subclasses:
DefinitionBase,DefinitionFile,OptionContainer
public abstract class WithOptions extends AbstractDataObject implements Observable
Base class for object that can be annotated.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWithOptions.TypeKindType codes for theWithOptionshierarchy.static interfaceWithOptions.Visitor<R,A>Visitor interface for theWithOptionshierarchy.
-
Field Summary
Fields Modifier and Type Field Description protected Listener_listenerstatic StringOPTIONS__PROP
-
Constructor Summary
Constructors Modifier Constructor Description protectedWithOptions()Creates aWithOptionsinstance.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Objectget(String field)Map<String,Option>getOptions()Annotations to this definition.protected voidinternalPutOption(String key, Option value)Implementation ofputOption(String, de.haumacher.msgbuf.generator.ast.Option)without chain call utility.protected voidinternalRegisterListener(Listener l)protected voidinternalSetOptions(Map<String,Option> value)Internal setter forgetOptions()without chain call utility.protected voidinternalUnregisterListener(Listener l)abstract WithOptions.TypeKindkind()The type code of this instance.List<String>properties()WithOptionsputOption(String key, Option value)Adds a key value pair to thegetOptions()map.protected voidreadField(JsonReader in, String field)static WithOptionsreadWithOptions(JsonReader in)Reads a new instance from the given reader.WithOptionsregisterListener(Listener l)voidremoveOption(String key)Removes a key from thegetOptions()map.voidset(String field, Object value)WithOptionssetOptions(Map<String,Option> value)WithOptionsunregisterListener(Listener l)abstract <R,A>
Rvisit(WithOptions.Visitor<R,A> v, A arg)Accepts the given visitor.protected voidwriteFields(JsonWriter out)voidwriteTo(JsonWriter out)-
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
-
OPTIONS__PROP
public static final String OPTIONS__PROP
- See Also:
getOptions(), Constant Field Values
-
_listener
protected Listener _listener
-
-
Constructor Detail
-
WithOptions
protected WithOptions()
Creates aWithOptionsinstance.
-
-
Method Detail
-
kind
public abstract WithOptions.TypeKind kind()
The type code of this instance.
-
setOptions
public WithOptions setOptions(Map<String,Option> value)
- See Also:
getOptions()
-
internalSetOptions
protected final void internalSetOptions(Map<String,Option> value)
Internal setter forgetOptions()without chain call utility.
-
putOption
public WithOptions putOption(String key, Option value)
Adds a key value pair to thegetOptions()map.
-
internalPutOption
protected final void internalPutOption(String key, Option value)
Implementation ofputOption(String, de.haumacher.msgbuf.generator.ast.Option)without chain call utility.
-
removeOption
public final void removeOption(String key)
Removes a key from thegetOptions()map.
-
registerListener
public WithOptions registerListener(Listener l)
- Specified by:
registerListenerin interfaceObservable
-
internalRegisterListener
protected final void internalRegisterListener(Listener l)
-
unregisterListener
public WithOptions unregisterListener(Listener l)
- Specified by:
unregisterListenerin interfaceObservable
-
internalUnregisterListener
protected final void internalUnregisterListener(Listener l)
-
properties
public List<String> properties()
- Specified by:
propertiesin interfaceReflectiveDataObject
-
get
public Object get(String field)
- Specified by:
getin interfaceReflectiveDataObject
-
set
public void set(String field, Object value)
- Specified by:
setin interfaceReflectiveDataObject
-
readWithOptions
public static WithOptions readWithOptions(JsonReader in) throws IOException
Reads a new instance from the given reader.- Throws:
IOException
-
writeTo
public final void writeTo(JsonWriter out) throws IOException
- Specified by:
writeToin interfaceDataObject- Throws:
IOException
-
writeFields
protected void writeFields(JsonWriter out) throws IOException
- Overrides:
writeFieldsin classAbstractDataObject- Throws:
IOException
-
readField
protected void readField(JsonReader in, String field) throws IOException
- Overrides:
readFieldin classAbstractDataObject- Throws:
IOException
-
visit
public abstract <R,A> R visit(WithOptions.Visitor<R,A> v, A arg)
Accepts the given visitor.
-
-