Package adams.data.textrenderer
Class AbstractTextRenderer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.textrenderer.AbstractTextRenderer
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,TextRenderer
,Serializable
- Direct Known Subclasses:
AbstractLimitedTextRenderer
,DefaultTextRenderer
,IndexedSplitsRunsRenderer
,JsonTextRenderer
,TextSupporterTextRenderer
public abstract class AbstractTextRenderer extends AbstractOptionHandler implements TextRenderer
Ancestor for text renderer classes.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static TextRenderer
m_Default
the default renderer.protected static List<TextRenderer>
m_Renderers
all available renderers.-
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 AbstractTextRenderer()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
check(Object obj)
Renders the object as text.protected abstract String
doRender(Object obj)
Renders the object as text.static TextRenderer
getDefaultRenderer()
Returns the default renderer.static TextRenderer
getRenderer(Class cls)
Returns the renderer for the specified class.static TextRenderer
getRenderer(Object obj)
Returns the renderer for the specified object.static List<TextRenderer>
getRenderers(Class cls)
Returns the renderers for the specified class.static List<TextRenderer>
getRenderers(Object obj)
Returns the renderers for the specified object.String
render(Object obj)
Renders the object as text.static String
renderObject(Object obj)
Renders the object.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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
-
Methods inherited from interface adams.data.textrenderer.TextRenderer
handles, handles
-
-
-
-
Field Detail
-
m_Renderers
protected static List<TextRenderer> m_Renderers
all available renderers.
-
m_Default
protected static TextRenderer m_Default
the default renderer.
-
-
Method Detail
-
check
protected String check(Object obj)
Renders the object as text.- Parameters:
obj
- the object to render- Returns:
- the generated string or null if failed to render
-
doRender
protected abstract String doRender(Object obj)
Renders the object as text.- Parameters:
obj
- the object to render- Returns:
- the generated string or null if failed to render
-
render
public String render(Object obj)
Renders the object as text.- Specified by:
render
in interfaceTextRenderer
- Parameters:
obj
- the object to render- Returns:
- the generated string or null if failed to render
-
getDefaultRenderer
public static TextRenderer getDefaultRenderer()
Returns the default renderer.- Returns:
- the default
-
getRenderer
public static TextRenderer getRenderer(Object obj)
Returns the renderer for the specified object.- Parameters:
obj
- the object to get the renderer for- Returns:
- the renderer
-
getRenderer
public static TextRenderer getRenderer(Class cls)
Returns the renderer for the specified class.- Parameters:
cls
- the class to get the renderer for- Returns:
- the renderer
-
getRenderers
public static List<TextRenderer> getRenderers(Object obj)
Returns the renderers for the specified object.- Parameters:
obj
- the object to get the renderer for- Returns:
- the renderers
-
getRenderers
public static List<TextRenderer> getRenderers(Class cls)
Returns the renderers for the specified class.- Parameters:
cls
- the class to get the renderer for- Returns:
- the renderers
-
-