Package adams.core.option
Class NestedProducer
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.option.AbstractOptionProducer<O,I>
-
- adams.core.option.AbstractRecursiveOptionProducer<List,List>
-
- adams.core.option.NestedProducer
-
- All Implemented Interfaces:
CleanUpHandler,EncodingSupporter,LoggingSupporter,BlacklistedOptionProducer,OptionProducer<List,List>,RecursiveOptionProducer,SizeOfHandler,Serializable
- Direct Known Subclasses:
DebugNestedProducer
public class NestedProducer extends AbstractRecursiveOptionProducer<List,List> implements BlacklistedOptionProducer, EncodingSupporter
Generates the nested format.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static char[]BACKQUOTE_CHARSthe characters to backquote.static String[]BACKQUOTE_STRINGSthe backquoted stringsf.static StringCHARSETthe information on the character set used.static StringCLASS_PATHthe information on the class path.static StringCOMMENTthe line comment character in files storing nested option handlers.static StringDATEthe information on the date.protected Class[]m_Blacklistedblacklisted classes.protected static DateFormatm_DateFormatfor formatting dates.protected BaseCharsetm_Encodingthe encoding to use.protected booleanm_OutputClasspathwhether to print the classpath.protected booleanm_OutputLineNumberswhether to print line numbers.protected booleanm_OutputPrologwhether to suppress the prolog.static StringMODULESthe information on the modules used.static StringPROJECTthe information about the project.static StringUSERthe information on the user.-
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 NestedProducer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ListdoProduce(AbstractOption option)Visits the option and obtains information from it.StringencodingTipText()Returns the tip text for this property.Class[]getBlacklisted()Returns the blacklisted classes.protected DateFormatgetDateFormat()Returns the formatter for the timestamps.BaseCharsetgetEncoding()Returns the encoding to use.booleangetOutputClasspath()Returns whether the classpath (comments) is generated.booleangetOutputLineNumbers()Returns whether line numbers get output.booleangetOutputProlog()Returns whether the prolog (comments) is generated.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Used for initializing members.protected ListinitOutput()Initializes the output data structure.static voidmain(String[] args)Executes the producer from commandline.StringoutputClasspathTipText()Returns the tip text for this property.StringoutputLineNumbersTipText()Returns the tip text for this property.StringoutputPrologTipText()Returns the tip text for this property.protected voidpostProduce()Hook-method after visiting options.protected voidpreProduce()Hook-method before starting visiting options.ListprocessOption(AbstractArgumentOption option)Visits an argument option.ListprocessOption(BooleanOption option)Visits a boolean option.ListprocessOption(ClassOption option)Visits a class option.voidsetBlacklisted(Class[] value)Sets the classes to avoid.voidsetEncoding(BaseCharset value)Sets the encoding to use.voidsetOutputClasspath(boolean value)Sets whether to output the classpath (in comments) or not.voidsetOutputLineNumbers(boolean value)Sets whether to output the line numbers.voidsetOutputProlog(boolean value)Sets whether to output the prolog (in comments) or not.StringtoString()Returns the output generated from the visit.StringtoString(List nested)Returns the output generated from the visit.-
Methods inherited from class adams.core.option.AbstractRecursiveOptionProducer
cleanUp, generateLoggingString, getDebugIndentation, getDebugIndentation, getRecursionLevel, reset
-
Methods inherited from class adams.core.option.AbstractOptionProducer
checkInput, doProduce, getCurrentValue, getInput, getOptionIdentifier, getOutput, getOutputVariableValues, getSkippedProperties, getUsePropertyNames, isDefaultValue, loggingLevelTipText, outputVariableValuesTipText, 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
getLoggingLevel
-
-
-
-
Field Detail
-
COMMENT
public static final String COMMENT
the line comment character in files storing nested option handlers.- See Also:
- Constant Field Values
-
PROJECT
public static final String PROJECT
the information about the project.- See Also:
- Constant Field Values
-
DATE
public static final String DATE
the information on the date.- See Also:
- Constant Field Values
-
USER
public static final String USER
the information on the user.- See Also:
- Constant Field Values
-
CHARSET
public static final String CHARSET
the information on the character set used.- See Also:
- Constant Field Values
-
MODULES
public static final String MODULES
the information on the modules used.- See Also:
- Constant Field Values
-
CLASS_PATH
public static final String CLASS_PATH
the information on the class path.- See Also:
- Constant Field Values
-
BACKQUOTE_CHARS
public static final char[] BACKQUOTE_CHARS
the characters to backquote.
-
BACKQUOTE_STRINGS
public static final String[] BACKQUOTE_STRINGS
the backquoted stringsf.
-
m_Blacklisted
protected Class[] m_Blacklisted
blacklisted classes.
-
m_OutputProlog
protected boolean m_OutputProlog
whether to suppress the prolog.
-
m_OutputClasspath
protected boolean m_OutputClasspath
whether to print the classpath.
-
m_OutputLineNumbers
protected boolean m_OutputLineNumbers
whether to print line numbers.
-
m_Encoding
protected BaseCharset m_Encoding
the encoding to use.
-
m_DateFormat
protected static DateFormat m_DateFormat
for formatting dates.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceOptionProducer<List,List>- Specified by:
globalInfoin classAbstractOptionProducer<List,List>- Returns:
- a description suitable for displaying in the gui
-
initialize
protected void initialize()
Used for initializing members.- Overrides:
initializein classAbstractOptionProducer<List,List>
-
getDateFormat
protected DateFormat getDateFormat()
Returns the formatter for the timestamps.- Returns:
- the formatter
-
setBlacklisted
public void setBlacklisted(Class[] value)
Sets the classes to avoid.- Specified by:
setBlacklistedin interfaceBlacklistedOptionProducer- Parameters:
value- the classes
-
getBlacklisted
public Class[] getBlacklisted()
Returns the blacklisted classes.- Specified by:
getBlacklistedin interfaceBlacklistedOptionProducer- Returns:
- the classes
-
setOutputProlog
public void setOutputProlog(boolean value)
Sets whether to output the prolog (in comments) or not.- Parameters:
value- if true then the prolog is generated
-
getOutputProlog
public boolean getOutputProlog()
Returns whether the prolog (comments) is generated.- Returns:
- true if the prolog is generated
-
outputPrologTipText
public String outputPrologTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOutputClasspath
public void setOutputClasspath(boolean value)
Sets whether to output the classpath (in comments) or not.- Parameters:
value- if true then the classpath is generated
-
getOutputClasspath
public boolean getOutputClasspath()
Returns whether the classpath (comments) is generated.- Returns:
- true if the classpath is generated
-
outputClasspathTipText
public String outputClasspathTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setOutputLineNumbers
public void setOutputLineNumbers(boolean value)
Sets whether to output the line numbers.- Parameters:
value- if true then the lines get prefixed with line numbers
-
getOutputLineNumbers
public boolean getOutputLineNumbers()
Returns whether line numbers get output.- Returns:
- true if lines get prefixed with line numbers
-
outputLineNumbersTipText
public String outputLineNumbersTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setEncoding
public void setEncoding(BaseCharset value)
Sets the encoding to use.- Specified by:
setEncodingin interfaceEncodingSupporter- Parameters:
value- the encoding, e.g. "UTF-8" or "UTF-16", empty string for default
-
getEncoding
public BaseCharset getEncoding()
Returns the encoding to use.- Specified by:
getEncodingin interfaceEncodingSupporter- Returns:
- the encoding, e.g. "UTF-8" or "UTF-16", empty string for default
-
encodingTipText
public String encodingTipText()
Returns the tip text for this property.- Specified by:
encodingTipTextin interfaceEncodingSupporter- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
initOutput
protected List initOutput()
Initializes the output data structure.- Specified by:
initOutputin classAbstractOptionProducer<List,List>- Returns:
- the created data structure
-
processOption
public List processOption(BooleanOption option)
Visits a boolean option.- Specified by:
processOptionin interfaceOptionProducer<List,List>- Specified by:
processOptionin classAbstractOptionProducer<List,List>- Parameters:
option- the boolean option- Returns:
- the last internal data structure that was generated
-
processOption
public List processOption(ClassOption option)
Visits a class option.- Specified by:
processOptionin interfaceOptionProducer<List,List>- Specified by:
processOptionin classAbstractOptionProducer<List,List>- Parameters:
option- the class option- Returns:
- the last internal data structure that was generated
-
processOption
public List processOption(AbstractArgumentOption option)
Visits an argument option.- Specified by:
processOptionin interfaceOptionProducer<List,List>- Specified by:
processOptionin classAbstractOptionProducer<List,List>- Parameters:
option- the argument option- Returns:
- the last internal data structure that was generated
-
toString
public String toString()
Returns the output generated from the visit.- Specified by:
toStringin interfaceOptionProducer<List,List>- Specified by:
toStringin classAbstractOptionProducer<List,List>- Returns:
- the output, null in case of an error
-
toString
public String toString(List nested)
Returns the output generated from the visit.- Returns:
- the output, null in case of an error
-
preProduce
protected void preProduce()
Hook-method before starting visiting options.- Overrides:
preProducein classAbstractOptionProducer<List,List>- See Also:
AbstractOptionProducer.initOutput()
-
doProduce
public List doProduce(AbstractOption option)
Visits the option and obtains information from it.- Specified by:
doProducein interfaceOptionProducer<List,List>- Overrides:
doProducein classAbstractOptionProducer<List,List>- Parameters:
option- the current option- Returns:
- the last internal data structure that was generated
-
postProduce
protected void postProduce()
Hook-method after visiting options.- Overrides:
postProducein classAbstractOptionProducer<List,List>
-
main
public static void main(String[] args)
Executes the producer from commandline.- Parameters:
args- the commandline arguments, use -help for help
-
-