Package adams.core.option
Class AbstractOptionTraverser
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.option.AbstractOptionTraverser
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,OptionTraverser
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
AbstractOptionTraverserWithResult
public abstract class AbstractOptionTraverser extends AbstractOptionHandler implements OptionTraverser
Ancestor for option traversers.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractOptionTraverser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
canHandle(AbstractOption option)
Returns whether the traverser is allowed to "handle" this option.abstract boolean
canRecurse(Class cls)
Returns whether the traverser can recurse the specified class (base class from a ClassOption).abstract boolean
canRecurse(Object obj)
Returns whether the traverser can recurse the specified object.String
globalInfo()
Returns a string describing the object.abstract void
handleArgumentOption(AbstractArgumentOption option, OptionTraversalPath path)
Handles the encountered argument option.abstract void
handleBooleanOption(BooleanOption option, OptionTraversalPath path)
Handles the encountered boolean option.abstract void
handleClassOption(ClassOption option, OptionTraversalPath path)
Handles the encountered class option.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
handleBooleanOption
public abstract void handleBooleanOption(BooleanOption option, OptionTraversalPath path)
Handles the encountered boolean option.- Specified by:
handleBooleanOption
in interfaceOptionTraverser
- Parameters:
option
- the option to handlepath
- the property path so far
-
handleClassOption
public abstract void handleClassOption(ClassOption option, OptionTraversalPath path)
Handles the encountered class option. Precedence over argument option.- Specified by:
handleClassOption
in interfaceOptionTraverser
- Parameters:
option
- the option to handlepath
- the property path so far
-
handleArgumentOption
public abstract void handleArgumentOption(AbstractArgumentOption option, OptionTraversalPath path)
Handles the encountered argument option.- Specified by:
handleArgumentOption
in interfaceOptionTraverser
- Parameters:
option
- the option to handlepath
- the property path so far
-
canHandle
public abstract boolean canHandle(AbstractOption option)
Returns whether the traverser is allowed to "handle" this option.- Specified by:
canHandle
in interfaceOptionTraverser
- Parameters:
option
- the option to check whether it can be handled- Returns:
- true if handling via
handleArgumentOption(AbstractArgumentOption, OptionTraversalPath)
,handleClassOption(ClassOption, OptionTraversalPath)
orhandleBooleanOption(BooleanOption, OptionTraversalPath)
is allowed
-
canRecurse
public abstract boolean canRecurse(Class cls)
Returns whether the traverser can recurse the specified class (base class from a ClassOption).- Specified by:
canRecurse
in interfaceOptionTraverser
- Parameters:
cls
- the class to determine for whether recursing is possible or not- Returns:
- true if to traverse the options recursively
-
canRecurse
public abstract boolean canRecurse(Object obj)
Returns whether the traverser can recurse the specified object.- Specified by:
canRecurse
in interfaceOptionTraverser
- Parameters:
obj
- the Object to determine for whether recursing is possible or not- Returns:
- true if to traverse the options recursively
-
-