Class 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.Observable
    Base class for object that can be annotated.
    • Constructor Detail

      • WithOptions

        protected WithOptions()
        Creates a WithOptions instance.
    • Method Detail

      • getOptions

        public final Map<String,​Option> getOptions()
        Annotations to this definition.
      • internalSetOptions

        protected final void internalSetOptions​(Map<String,​Option> value)
        Internal setter for getOptions() without chain call utility.
      • removeOption

        public final void removeOption​(String key)
        Removes a key from the getOptions() map.
      • registerListener

        public WithOptions registerListener​(de.haumacher.msgbuf.observer.Listener l)
        Specified by:
        registerListener in interface de.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:
        unregisterListener in interface de.haumacher.msgbuf.observer.Observable
      • internalUnregisterListener

        protected final void internalUnregisterListener​(de.haumacher.msgbuf.observer.Listener l)
      • properties

        public List<String> properties()
        Specified by:
        properties in interface de.haumacher.msgbuf.data.ReflectiveDataObject
      • get

        public Object get​(String field)
        Specified by:
        get in interface de.haumacher.msgbuf.data.ReflectiveDataObject
      • set

        public void set​(String field,
                        Object value)
        Specified by:
        set in interface de.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:
        writeTo in interface de.haumacher.msgbuf.data.DataObject
        Throws:
        IOException
      • writeFields

        protected void writeFields​(de.haumacher.msgbuf.json.JsonWriter out)
                            throws IOException
        Overrides:
        writeFields in class de.haumacher.msgbuf.data.AbstractDataObject
        Throws:
        IOException
      • readField

        protected void readField​(de.haumacher.msgbuf.json.JsonReader in,
                                 String field)
                          throws IOException
        Overrides:
        readField in class de.haumacher.msgbuf.data.AbstractDataObject
        Throws:
        IOException
      • visit

        public abstract <R,​A> R visit​(WithOptions.Visitor<R,​A> v,
                                            A arg)
        Accepts the given visitor.