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.
        Parameters:
        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.
        Returns:
        true if debugging output is enabled
      • getMinUserMode

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

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

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

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

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

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

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

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

        public boolean getOutputDefaultValue()
        Returns whether the default value is to be output or not in help strings, etc.
        Returns:
        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.
        Returns:
        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.
        Returns:
        the method for returning the tooltip, can be null
      • getReadMethod

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

        protected Method getWriteMethod()
        Returns the write method for the property.
        Returns:
        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