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 class
XhtmlProducer.ActorOptionTraverser
-
Nested classes/interfaces inherited from class adams.core.option.AbstractDocumentationProducer
AbstractDocumentationProducer.ActorPosition
-
-
Field Summary
Fields Modifier and Type Field Description protected Document
m_Document
the output vector.protected boolean
m_OutputDefaultValues
whether 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 void
addSynopsis(AbstractTag parent, Object obj)
Adds anTable
with the global info an potential additional information.void
cleanUp()
Cleans up data structures, frees up memory.void
defineOptions()
Adds options to the internal list of options.protected void
generateDocument()
Generates the documentation.String
getDefaultFormatExtension()
Returns the default file extension (without the dot).String
getFormatDescription()
Returns the description of the file format.String[]
getFormatExtensions()
Returns the file extensions (without the dot).String
getOutput()
Returns the output generated from the visit.boolean
getOutputDefaultValues()
Returns whyether default values are output as well.String
globalInfo()
Returns a string describing the object.protected void
initialize()
Initializes the visitor.protected String
initOutput()
Initializes the output data structure.static void
main(String[] args)
Executes the producer from commandline.String
outputDefaultValuesTipText()
Returns the tip text for this property.protected void
preProduce()
Hook-method before starting visiting options.void
setOutputDefaultValues(boolean value)
Sets whether to output default values as well.protected String
toPlainText(Node node)
Returns the node in plain text.protected String
toPlainText(Tree tree)
Generates a string representation of the tree in plain text.protected void
toPlainText(StringBuilder builder, int level, BaseTreeNode node, List<Boolean> more)
Adds the node (and its potentional children) to the StringBuilder.String
toString()
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:
globalInfo
in interfaceOptionProducer<String,StringBuilder>
- Specified by:
globalInfo
in 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:
defineOptions
in interfaceOptionHandler
- Specified by:
defineOptions
in interfaceOptionProducerWithOptionHandling<String,StringBuilder>
- Overrides:
defineOptions
in classAbstractRecursiveOptionProducerWithOptionHandling<String,StringBuilder>
-
initialize
protected void initialize()
Initializes the visitor.- Overrides:
initialize
in classAbstractDocumentationProducer<String>
-
initOutput
protected String initOutput()
Initializes the output data structure.- Specified by:
initOutput
in 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 anTable
with 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:
preProduce
in 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:
getOutput
in interfaceOptionProducer<String,StringBuilder>
- Overrides:
getOutput
in classAbstractOptionProducer<String,StringBuilder>
- Returns:
- the output
- See Also:
AbstractOptionProducer.initOutput()
-
toString
public String toString()
Returns the output generated from the visit.- Specified by:
toString
in interfaceOptionProducer<String,StringBuilder>
- Specified by:
toString
in 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:
cleanUp
in interfaceCleanUpHandler
- Specified by:
cleanUp
in interfaceOptionProducer<String,StringBuilder>
- Overrides:
cleanUp
in classAbstractRecursiveOptionProducer<String,StringBuilder>
-
getFormatDescription
public String getFormatDescription()
Returns the description of the file format.- Specified by:
getFormatDescription
in interfaceFileFormatHandler
- Returns:
- the description
-
getDefaultFormatExtension
public String getDefaultFormatExtension()
Returns the default file extension (without the dot).- Specified by:
getDefaultFormatExtension
in interfaceFileFormatHandler
- Returns:
- the default extension
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the file extensions (without the dot).- Specified by:
getFormatExtensions
in 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
-
-