Package adams.data.io.output
Class AbstractTextWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.AbstractTextWriter
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Serializable
- Direct Known Subclasses:
AbstractTextWriterWithEncoding
,NullWriter
public abstract class AbstractTextWriter extends AbstractOptionHandler
Ancestor for classes that can write text documents.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_Enabled
whether the writer is enabled.-
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 AbstractTextWriter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected abstract String
doWrite(String content, String name)
Writes the given content under the specified name.String
enabledTipText()
Returns the tip text for this property.boolean
getEnabled()
Returns whether the writer is enabled.void
setEnabled(boolean value)
Sets whether the writer is enabled.String
write(TextContainer content, String name)
Writes the given content under the specified name.String
write(String content, String name)
Writes the given content under the specified name.-
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
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setEnabled
public void setEnabled(boolean value)
Sets whether the writer is enabled.- Parameters:
value
- true if to enable writer
-
getEnabled
public boolean getEnabled()
Returns whether the writer is enabled.- Returns:
- true if writer is enabled
-
enabledTipText
public String enabledTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doWrite
protected abstract String doWrite(String content, String name)
Writes the given content under the specified name.- Parameters:
content
- the content to writename
- the name under which to save the content- Returns:
- if a file was generated, the filename the content was written as, otherwise null
-
write
public String write(String content, String name)
Writes the given content under the specified name.- Parameters:
content
- the content to writename
- the name under which to save the content- Returns:
- if a file was generated, the filename the content was written as, otherwise null
-
write
public String write(TextContainer content, String name)
Writes the given content under the specified name.- Parameters:
content
- the content to writename
- the name under which to save the content- Returns:
- if a file was generated, the filename the content was written as, otherwise null
-
-