Class WithOptions
- java.lang.Object
-
- de.haumacher.msgbuf.data.AbstractDataObject
-
- de.haumacher.msgbuf.generator.ast.WithOptions
-
- All Implemented Interfaces:
de.haumacher.msgbuf.data.DataObject,de.haumacher.msgbuf.data.ReflectiveDataObject,de.haumacher.msgbuf.observer.Observable
- Direct Known Subclasses:
DefinitionBase,DefinitionFile,OptionContainer
public abstract class WithOptions extends de.haumacher.msgbuf.data.AbstractDataObject implements de.haumacher.msgbuf.observer.ObservableBase 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.
-
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, Option)without chain call utility.protected voidinternalRegisterListener(de.haumacher.msgbuf.observer.Listener l)protected voidinternalSetOptions(Map<String,Option> value)Internal setter forgetOptions()without chain call utility.protected voidinternalUnregisterListener(de.haumacher.msgbuf.observer.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(de.haumacher.msgbuf.json.JsonReader in, String field)static WithOptionsreadWithOptions(de.haumacher.msgbuf.json.JsonReader in)Reads a new instance from the given reader.WithOptionsregisterListener(de.haumacher.msgbuf.observer.Listener l)voidremoveOption(String key)Removes a key from thegetOptions()map.voidset(String field, Object value)WithOptionssetOptions(Map<String,Option> value)WithOptionsunregisterListener(de.haumacher.msgbuf.observer.Listener l)abstract <R,A>
Rvisit(WithOptions.Visitor<R,A> v, A arg)Accepts the given visitor.protected voidwriteFields(de.haumacher.msgbuf.json.JsonWriter out)voidwriteTo(de.haumacher.msgbuf.json.JsonWriter out)-
Methods inherited from class de.haumacher.msgbuf.data.AbstractDataObject
readFields, toString, writeContent
-
-
-
-
Field Detail
-
OPTIONS
public static final String OPTIONS
- See Also:
getOptions(), Constant Field Values
-
_listener
protected de.haumacher.msgbuf.observer.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, Option)without chain call utility.
-
removeOption
public final void removeOption(String key)
Removes a key from thegetOptions()map.
-
registerListener
public WithOptions registerListener(de.haumacher.msgbuf.observer.Listener l)
- Specified by:
registerListenerin interfacede.haumacher.msgbuf.observer.Observable
-
internalRegisterListener
protected final void internalRegisterListener(de.haumacher.msgbuf.observer.Listener l)
-
unregisterListener
public WithOptions unregisterListener(de.haumacher.msgbuf.observer.Listener l)
- Specified by:
unregisterListenerin interfacede.haumacher.msgbuf.observer.Observable
-
internalUnregisterListener
protected final void internalUnregisterListener(de.haumacher.msgbuf.observer.Listener l)
-
properties
public List<String> properties()
- Specified by:
propertiesin interfacede.haumacher.msgbuf.data.ReflectiveDataObject
-
get
public Object get(String field)
- Specified by:
getin interfacede.haumacher.msgbuf.data.ReflectiveDataObject
-
set
public void set(String field, Object value)
- Specified by:
setin interfacede.haumacher.msgbuf.data.ReflectiveDataObject
-
readWithOptions
public static WithOptions readWithOptions(de.haumacher.msgbuf.json.JsonReader in) throws IOException
Reads a new instance from the given reader.- Throws:
IOException
-
writeTo
public final void writeTo(de.haumacher.msgbuf.json.JsonWriter out) throws IOException- Specified by:
writeToin interfacede.haumacher.msgbuf.data.DataObject- Throws:
IOException
-
writeFields
protected void writeFields(de.haumacher.msgbuf.json.JsonWriter out) throws IOException- Overrides:
writeFieldsin classde.haumacher.msgbuf.data.AbstractDataObject- Throws:
IOException
-
readField
protected void readField(de.haumacher.msgbuf.json.JsonReader in, String field) throws IOException- Overrides:
readFieldin classde.haumacher.msgbuf.data.AbstractDataObject- Throws:
IOException
-
visit
public abstract <R,A> R visit(WithOptions.Visitor<R,A> v, A arg)
Accepts the given visitor.
-
-