Package adams.core.option
Class ConcreteBaseClassesOptionTraverser
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.option.AbstractOptionTraverser
-
- adams.core.option.AbstractOptionTraverserWithResult<Set<Class>>
-
- adams.core.option.ConcreteBaseClassesOptionTraverser
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,OptionTraverser,OptionTraverserWithResult<Set<Class>>,SizeOfHandler,Serializable
public class ConcreteBaseClassesOptionTraverser extends AbstractOptionTraverserWithResult<Set<Class>>
Determines all the base classes, must be not abstract and actual classes, not interfaces.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<Class>m_Classesfor collecting the classes.-
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 ConcreteBaseClassesOptionTraverser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandle(AbstractOption option)Returns whether the traverser is allowed to "handle" this option.booleancanRecurse(Class cls)Returns whether the traverser can recurse the specified class (base class from a ClassOption).booleancanRecurse(Object obj)Returns whether the traverser can recurse the specified object.Set<Class>getResult()Returns the result of the traversal.voidhandleArgumentOption(AbstractArgumentOption option, OptionTraversalPath path)Handles the encountered argument option.voidhandleBooleanOption(BooleanOption option, OptionTraversalPath path)Handles the encountered boolean option.voidhandleClassOption(ClassOption option, OptionTraversalPath path)Handles the encountered class option.voidresetResult()Resets the result before traversing.-
Methods inherited from class adams.core.option.AbstractOptionTraverserWithResult
initialize, reset
-
Methods inherited from class adams.core.option.AbstractOptionTraverser
globalInfo
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, toCommandLine, toString
-
Methods inherited from class adams.core.logging.CustomLoggingLevelObject
setLoggingLevel
-
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
-
handleBooleanOption
public void handleBooleanOption(BooleanOption option, OptionTraversalPath path)
Handles the encountered boolean option.- Specified by:
handleBooleanOptionin interfaceOptionTraverser- Specified by:
handleBooleanOptionin classAbstractOptionTraverser- Parameters:
option- the option to handlepath- the property path so far
-
handleClassOption
public void handleClassOption(ClassOption option, OptionTraversalPath path)
Handles the encountered class option. Precedence over argument option.- Specified by:
handleClassOptionin interfaceOptionTraverser- Specified by:
handleClassOptionin classAbstractOptionTraverser- Parameters:
option- the option to handlepath- the property path so far
-
handleArgumentOption
public void handleArgumentOption(AbstractArgumentOption option, OptionTraversalPath path)
Handles the encountered argument option.- Specified by:
handleArgumentOptionin interfaceOptionTraverser- Specified by:
handleArgumentOptionin classAbstractOptionTraverser- Parameters:
option- the option to handlepath- the property path so far
-
canHandle
public boolean canHandle(AbstractOption option)
Returns whether the traverser is allowed to "handle" this option.- Specified by:
canHandlein interfaceOptionTraverser- Specified by:
canHandlein classAbstractOptionTraverser- 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 boolean canRecurse(Class cls)
Returns whether the traverser can recurse the specified class (base class from a ClassOption).- Specified by:
canRecursein interfaceOptionTraverser- Specified by:
canRecursein classAbstractOptionTraverser- Parameters:
cls- the class to determine for whether recursing is possible or not- Returns:
- true if to traverse the options recursively
-
canRecurse
public boolean canRecurse(Object obj)
Returns whether the traverser can recurse the specified object.- Specified by:
canRecursein interfaceOptionTraverser- Specified by:
canRecursein classAbstractOptionTraverser- Parameters:
obj- the Object to determine for whether recursing is possible or not- Returns:
- true if to traverse the options recursively
-
resetResult
public void resetResult()
Resets the result before traversing.- Specified by:
resetResultin interfaceOptionTraverserWithResult<Set<Class>>- Specified by:
resetResultin classAbstractOptionTraverserWithResult<Set<Class>>
-
getResult
public Set<Class> getResult()
Returns the result of the traversal.- Specified by:
getResultin interfaceOptionTraverserWithResult<Set<Class>>- Specified by:
getResultin classAbstractOptionTraverserWithResult<Set<Class>>- Returns:
- the result
-
-