Package adams.core.option.help
Class AbstractHelpGenerator
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.core.option.help.AbstractHelpGenerator
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,SizeOfHandler,Serializable
- Direct Known Subclasses:
AdditionalInformation,CapabilitiesInfo,ClassCrossReferences,ConditionalEquivalentActor,Deprecation,SupportedTags
public abstract class AbstractHelpGenerator extends AbstractOptionHandler
Ancestor for help generators.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static LoggerLOGGERfor logging in static context.protected booleanm_ClassCrossRefLinkswhether to generate "fake" class cross reference links.-
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 AbstractHelpGenerator()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringclassCrossRefLinksTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.abstract Stringgenerate(Object obj, HelpFormat format)Generates the help for the object in the requested format.static StringgenerateAll(Object obj, HelpFormat format)Generates the combined help using all generators.booleangetClassCrossRefLinks()Returns whether to generate class cross-reference links for the help user interface.abstract booleanhandles(Class cls)Checks whether the generator handles this class.booleanhandles(Object obj)Checks whether the generator handles this object.voidsetClassCrossRefLinks(boolean value)Sets whether to generate class cross-reference links for the help user interface.protected StringtoHTML(String s)Turns the string into HTML.protected StringtoHTML(String s, boolean nbsp)Turns the string into HTML.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, 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
-
-
-
-
Field Detail
-
LOGGER
protected static Logger LOGGER
for logging in static context.
-
m_ClassCrossRefLinks
protected boolean m_ClassCrossRefLinks
whether to generate "fake" class cross reference links.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setClassCrossRefLinks
public void setClassCrossRefLinks(boolean value)
Sets whether to generate class cross-reference links for the help user interface.- Parameters:
value- true if to generate
-
getClassCrossRefLinks
public boolean getClassCrossRefLinks()
Returns whether to generate class cross-reference links for the help user interface.- Returns:
- true if to generate
-
classCrossRefLinksTipText
public String classCrossRefLinksTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
handles
public boolean handles(Object obj)
Checks whether the generator handles this object.- Parameters:
obj- the object to check- Returns:
- true if it can handle the object
-
handles
public abstract boolean handles(Class cls)
Checks whether the generator handles this class.- Parameters:
cls- the class to check- Returns:
- true if it can handle the class
-
toHTML
protected String toHTML(String s)
Turns the string into HTML. Line feeds are automatically converted into <br>.- Parameters:
s- the string to convert to HTML- Returns:
- the HTML string
- See Also:
HtmlUtils.markUpURLs(String, boolean)
-
toHTML
protected String toHTML(String s, boolean nbsp)
Turns the string into HTML. Line feeds are automatically converted into <br>.- Parameters:
s- the string to convert to HTMLnbsp- whether to convert leading blanks to non-breaking spaces- Returns:
- the HTML string
- See Also:
HtmlUtils.markUpURLs(String, boolean)
-
generate
public abstract String generate(Object obj, HelpFormat format)
Generates the help for the object in the requested format.- Parameters:
obj- the object to generate the help forformat- the format of the output- Returns:
- the generated help
-
generateAll
public static String generateAll(Object obj, HelpFormat format)
Generates the combined help using all generators.- Parameters:
obj- the object to generate the help forformat- the format of the output- Returns:
- the generated help
-
-