Package adams.core.option
Class XhtmlProducer
-
- All Implemented Interfaces:
CleanUpHandler,Destroyable,FileFormatHandler,LoggingSupporter,OptionHandler,OptionProducer<String,StringBuilder>,OptionProducerWithOptionHandling<String,StringBuilder>,RecursiveOptionProducer,SizeOfHandler,Serializable
public class XhtmlProducer extends AbstractDocumentationProducer<String> implements RecursiveOptionProducer, FileFormatHandler
Generates documentation in XHTML.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXhtmlProducer.ActorOptionTraverser-
Nested classes/interfaces inherited from class adams.core.option.AbstractDocumentationProducer
AbstractDocumentationProducer.ActorPosition
-
-
Field Summary
Fields Modifier and Type Field Description protected Documentm_Documentthe output vector.protected booleanm_OutputDefaultValueswhether to output default values as well.-
Fields inherited from class adams.core.option.AbstractDocumentationProducer
m_Index, m_NamePosition, m_Positions
-
Fields inherited from class adams.core.option.AbstractRecursiveOptionProducerWithOptionHandling
m_OptionManager
-
Fields inherited from class adams.core.option.AbstractRecursiveOptionProducer
m_Nesting
-
Fields inherited from class adams.core.option.AbstractOptionProducer
m_Input, m_LastGenerated, m_Output, m_OutputVariableValues, m_SkippedProperties, m_UsePropertyNames
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description XhtmlProducer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddSynopsis(AbstractTag parent, Object obj)Adds anTablewith the global info an potential additional information.voidcleanUp()Cleans up data structures, frees up memory.voiddefineOptions()Adds options to the internal list of options.protected voidgenerateDocument()Generates the documentation.StringgetDefaultFormatExtension()Returns the default file extension (without the dot).StringgetFormatDescription()Returns the description of the file format.String[]getFormatExtensions()Returns the file extensions (without the dot).StringgetOutput()Returns the output generated from the visit.booleangetOutputDefaultValues()Returns whyether default values are output as well.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Initializes the visitor.protected StringinitOutput()Initializes the output data structure.static voidmain(String[] args)Executes the producer from commandline.StringoutputDefaultValuesTipText()Returns the tip text for this property.protected voidpreProduce()Hook-method before starting visiting options.voidsetOutputDefaultValues(boolean value)Sets whether to output default values as well.protected StringtoPlainText(Node node)Returns the node in plain text.protected StringtoPlainText(Tree tree)Generates a string representation of the tree in plain text.protected voidtoPlainText(StringBuilder builder, int level, BaseTreeNode node, List<Boolean> more)Adds the node (and its potentional children) to the StringBuilder.StringtoString()Returns the output generated from the visit.-
Methods inherited from class adams.core.option.AbstractDocumentationProducer
addPosition, processOption, processOption, processOption
-
Methods inherited from class adams.core.option.AbstractRecursiveOptionProducerWithOptionHandling
cleanUpOptions, destroy, finishInit, getOptionManager, newOptionManager, toCommandLine
-
Methods inherited from class adams.core.option.AbstractRecursiveOptionProducer
generateLoggingString, getDebugIndentation, getDebugIndentation, getRecursionLevel, reset
-
Methods inherited from class adams.core.option.AbstractOptionProducer
checkInput, doProduce, doProduce, getCurrentValue, getInput, getOptionIdentifier, getOutputVariableValues, getSkippedProperties, getUsePropertyNames, isDefaultValue, loggingLevelTipText, outputVariableValuesTipText, postProduce, postProduce, preProduce, produce, produce, runProducer, setLoggingLevel, setOutputVariableValues, setSkippedProperties, toString, write
-
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.option.OptionProducer
doProduce, getInput, getLoggingLevel, getOutputVariableValues, getSkippedProperties, getUsePropertyNames, loggingLevelTipText, outputVariableValuesTipText, produce, setLoggingLevel, setOutputVariableValues, setSkippedProperties, write
-
Methods inherited from interface adams.core.option.RecursiveOptionProducer
getRecursionLevel
-
-
-
-
Field Detail
-
m_Document
protected Document m_Document
the output vector.
-
m_OutputDefaultValues
protected boolean m_OutputDefaultValues
whether to output default values as well.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceOptionProducer<String,StringBuilder>- Specified by:
globalInfoin classAbstractOptionProducer<String,StringBuilder>- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options. Derived classes must override this method to add additional options.- Specified by:
defineOptionsin interfaceOptionHandler- Specified by:
defineOptionsin interfaceOptionProducerWithOptionHandling<String,StringBuilder>- Overrides:
defineOptionsin classAbstractRecursiveOptionProducerWithOptionHandling<String,StringBuilder>
-
initialize
protected void initialize()
Initializes the visitor.- Overrides:
initializein classAbstractDocumentationProducer<String>
-
initOutput
protected String initOutput()
Initializes the output data structure.- Specified by:
initOutputin classAbstractOptionProducer<String,StringBuilder>- Returns:
- the created data structure
-
setOutputDefaultValues
public void setOutputDefaultValues(boolean value)
Sets whether to output default values as well.- Parameters:
value- if true then default values are output as well
-
getOutputDefaultValues
public boolean getOutputDefaultValues()
Returns whyether default values are output as well.- Returns:
- true if default values are output as well
-
outputDefaultValuesTipText
public String outputDefaultValuesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
toPlainText
protected String toPlainText(Tree tree)
Generates a string representation of the tree in plain text.- Parameters:
tree- the flow tree to turn into plain text- Returns:
- the string representation
-
toPlainText
protected String toPlainText(Node node)
Returns the node in plain text.- Parameters:
node- the node to turn into plain text- Returns:
- the plain text representation
-
toPlainText
protected void toPlainText(StringBuilder builder, int level, BaseTreeNode node, List<Boolean> more)
Adds the node (and its potentional children) to the StringBuilder.- Parameters:
builder- for adding the tree structure tolevel- the current level (for indentation)node- the node to processmore- for keeping track whether more siblings come after the node
-
addSynopsis
protected void addSynopsis(AbstractTag parent, Object obj)
Adds anTablewith the global info an potential additional information.- Parameters:
parent- the parent to add the elements toobj- the object to process
-
preProduce
protected void preProduce()
Hook-method before starting visiting options.- Overrides:
preProducein classAbstractDocumentationProducer<String>- See Also:
AbstractOptionProducer.initOutput()
-
generateDocument
protected void generateDocument()
Generates the documentation.
-
getOutput
public String getOutput()
Returns the output generated from the visit.- Specified by:
getOutputin interfaceOptionProducer<String,StringBuilder>- Overrides:
getOutputin classAbstractOptionProducer<String,StringBuilder>- Returns:
- the output
- See Also:
AbstractOptionProducer.initOutput()
-
toString
public String toString()
Returns the output generated from the visit.- Specified by:
toStringin interfaceOptionProducer<String,StringBuilder>- Specified by:
toStringin classAbstractOptionProducer<String,StringBuilder>- Returns:
- the output, null in case of an error
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceCleanUpHandler- Specified by:
cleanUpin interfaceOptionProducer<String,StringBuilder>- Overrides:
cleanUpin classAbstractRecursiveOptionProducer<String,StringBuilder>
-
getFormatDescription
public String getFormatDescription()
Returns the description of the file format.- Specified by:
getFormatDescriptionin interfaceFileFormatHandler- Returns:
- the description
-
getDefaultFormatExtension
public String getDefaultFormatExtension()
Returns the default file extension (without the dot).- Specified by:
getDefaultFormatExtensionin interfaceFileFormatHandler- Returns:
- the default extension
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the file extensions (without the dot).- Specified by:
getFormatExtensionsin interfaceFileFormatHandler- Returns:
- the extensions
-
main
public static void main(String[] args)
Executes the producer from commandline.- Parameters:
args- the commandline arguments, use -help for help
-
-