Class AbstractOption

    • Field Detail

      • m_Commandline

        protected String m_Commandline
        the commandline option, without the leading "-".
      • m_Property

        protected String m_Property
        the bean property to use for getting/setting.
      • m_DefaultValue

        protected Object m_DefaultValue
        the default value for this option.
      • m_OutputDefaultValue

        protected boolean m_OutputDefaultValue
        whether to output the default value for this option.
      • m_Debug

        protected boolean m_Debug
        whether debugging is enabled.
      • m_MinUserMode

        protected UserMode m_MinUserMode
        in what usermode to show this option.
    • Constructor Detail

      • AbstractOption

        protected AbstractOption​(OptionManager owner,
                                 String commandline,
                                 String property,
                                 Object defValue,
                                 boolean outputDefValue,
                                 UserMode minUserMode)
        Initializes the option.
        owner - the owner of this option
        commandline - the commandline string to identify the option (no leading dash)
        property - the name of the bean property
        defValue - the default value, if null then the owner's current state is used
        outputDefValue - whether to output the default value or not when listing the options
        minUserMode - the minimum user mode before showing this option
    • Method Detail

      • getDebug

        public boolean getDebug()
        Returns whether debugging output is enabled.
        true if debugging output is enabled
      • getMinUserMode

        public UserMode getMinUserMode()
        Returns the minimum user mode before this option is displayed.
        the minimum user mode
      • getOwner

        public OptionManager getOwner()
        Returns the owning object.
        the owner of this option
      • getOptionHandler

        public OptionHandler getOptionHandler()
        Returns the option handler this option belongs to.
        the owning OptionHandler
      • getCommandline

        public String getCommandline()
        Returns the commandline options string, without the "-".
        the commandline string
      • getProperty

        public String getProperty()
        Returns the property used for getting/setting the option.
        the property responsible for getting/setting
      • getDefaultValue

        public Object getDefaultValue()
        Returns the default value for this option.
        the default value
      • getCurrentValue

        public Object getCurrentValue()
        Returns the current value for this option (obtained via the get-method).
        the current value
      • setCurrentValue

        public boolean setCurrentValue​(Object value)
        Sets the current value.
        value - the value to set
        true if successfully set
      • getOutputDefaultValue

        public boolean getOutputDefaultValue()
        Returns whether the default value is to be output or not in help strings, etc.
        true if the default value is to be output
      • getDescriptor

        public PropertyDescriptor getDescriptor()
        Returns the bean property descriptor for the get/set methods. Should never be null, unless the property cannot be found in the owner.
        the bean property descriptor
      • getToolTipMethod

        public Method getToolTipMethod()
        Returns the method for obtaining the tooltip. Can be null, if no corresponding tooltip was found for the property.
        the method for returning the tooltip, can be null
      • getReadMethod

        protected Method getReadMethod()
        Returns the read method for the property.
        the method, null if no property descriptor available
      • getWriteMethod

        protected Method getWriteMethod()
        Returns the write method for the property.
        the method, null if no property descriptor available
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory.
        Specified by:
        cleanUp in interface CleanUpHandler