Class Option

  • All Implemented Interfaces:
    de.haumacher.msgbuf.data.DataObject, de.haumacher.msgbuf.data.ReflectiveDataObject, de.haumacher.msgbuf.observer.Observable
    Direct Known Subclasses:
    Flag, NumberOption, StringOption

    public abstract class Option
    extends de.haumacher.msgbuf.data.AbstractDataObject
    implements de.haumacher.msgbuf.observer.Observable
    Base class for an option annotation.
    See Also:
    StringOption, NumberOption, Flag
    • Field Detail

      • _listener

        protected de.haumacher.msgbuf.observer.Listener _listener
    • Constructor Detail

      • Option

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

      • kind

        public abstract Option.TypeKind kind()
        The type code of this instance.
      • registerListener

        public Option 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 Option 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)
      • readOption

        public static Option readOption​(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
      • visit

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