Package adams.core.option.description
Class AbstractClassDescriptionGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.option.description.AbstractClassDescriptionGenerator
-
- All Implemented Interfaces:
LoggingSupporter,ClassDescriptionGenerator,SizeOfHandler,Serializable
- Direct Known Subclasses:
AdamsClassDescriptionGenerator,WekaClassDescriptionGenerator
public abstract class AbstractClassDescriptionGenerator extends LoggingObject implements ClassDescriptionGenerator
Ancestor for classes that generate descriptions from classes as nested Map objects.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static Map<Class,Class>m_Cachethe cache for object class / handler relation.protected static Class[]m_GeneratorClassesthe handlers (classes) currently available.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.core.option.description.ClassDescriptionGenerator
KEY_CLASS, KEY_OPTIONS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractClassDescriptionGenerator()Initializes the handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>generate(Class cls)Generates the description for the class.static AbstractClassDescriptionGeneratorgetHandler(Class cls)Returns a handler for the specified class.static AbstractClassDescriptionGeneratorgetHandler(Object obj)Returns a handler for the specified object.booleanhandles(Object obj)Checks whether this object is handled by this generator.protected static voidinitHandlers()Initializes the handlers.protected voidinitialize()For initializing members.-
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, toString, wait, wait, wait
-
Methods inherited from interface adams.core.option.description.ClassDescriptionGenerator
generate, handles
-
-
-
-
Method Detail
-
initialize
protected void initialize()
For initializing members.
Default implementation does nothing.
-
handles
public boolean handles(Object obj)
Checks whether this object is handled by this generator.- Specified by:
handlesin interfaceClassDescriptionGenerator- Parameters:
obj- the object to check- Returns:
- true if handled
-
generate
public Map<String,Object> generate(Class cls)
Generates the description for the class.- Specified by:
generatein interfaceClassDescriptionGenerator- Parameters:
cls- the class to process- Returns:
- the description, null if failed to generate
-
initHandlers
protected static void initHandlers()
Initializes the handlers.
-
getHandler
public static AbstractClassDescriptionGenerator getHandler(Object obj)
Returns a handler for the specified object.- Parameters:
obj- the object to get a commandline handler for- Returns:
- the handler
-
getHandler
public static AbstractClassDescriptionGenerator getHandler(Class cls)
Returns a handler for the specified class.- Parameters:
cls- the class to get a commandline handler for- Returns:
- the handler, null if none available
-
-