Package adams.data.conversion
Class UnQuote
-
- All Implemented Interfaces:
AdditionalInformationHandler
,ClassCrossReference
,CleanUpHandler
,CrossReference
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<AbstractConversion>
,SizeOfHandler
,Stoppable
,Conversion
,ConversionFromString
,ConversionToString
,Serializable
public class UnQuote extends AbstractStringConversion implements ClassCrossReference
Removes the quotes (single or double) surrounding a string. Also unbackquotes new lines and tabs.
See also:
adams.data.conversion.Quote
adams.data.conversion.BackQuote
adams.data.conversion.UnBackQuote
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-quote-type <SINGLE|DOUBLE|DOUBLE_UP> (property: quoteType) The type of quote to use. default: DOUBLE
-double-up <boolean> (property: doubleUp) If enabled, internal quotes get un-doubled up rather than un-escaped with backslashes. default: false
- 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_DoubleUp
whether to double up internal quotes rather than escaping them with backslashes.protected Quote.QuoteType
m_QuoteType
the quote type to use.-
Fields inherited from class adams.data.conversion.AbstractConversion
m_Input, m_Output, m_Owner, m_Stopped
-
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 UnQuote()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected Object
doConvert()
Performs the actual conversion.String
doubleUpTipText()
Returns the tip text for this property.Class[]
getClassCrossReferences()
Returns the cross-referenced classes.boolean
getDoubleUp()
Returns whether to un-double up internal quotes rather than un-escaping with backslash.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.Quote.QuoteType
getQuoteType()
Returns the type of quote to use.String
globalInfo()
Returns a string describing the object.String
quoteTypeTipText()
Returns the tip text for this property.void
setDoubleUp(boolean value)
Sets whether to un-double up internal quotes rather than un-escaping with backslash.void
setQuoteType(Quote.QuoteType value)
Sets the type of quote to use.-
Methods inherited from class adams.data.conversion.AbstractStringConversion
accepts, generates
-
Methods inherited from class adams.data.conversion.AbstractConversion
checkData, cleanUp, convert, getAdditionalInformation, getInput, getInput, getOutput, getOutput, getOwner, reset, setInput, setOwner, shallowCopy, shallowCopy, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, 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.CleanUpHandler
cleanUp
-
Methods inherited from interface adams.data.conversion.Conversion
convert, getInput, getInput, getOutput, getOutput, getOwner, setInput, setOwner
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.Stoppable
stopExecution
-
-
-
-
Field Detail
-
m_QuoteType
protected Quote.QuoteType m_QuoteType
the quote type to use.
-
m_DoubleUp
protected boolean m_DoubleUp
whether to double up internal quotes rather than escaping them with backslashes.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
getClassCrossReferences
public Class[] getClassCrossReferences()
Returns the cross-referenced classes.- Specified by:
getClassCrossReferences
in interfaceClassCrossReference
- Returns:
- the classes
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setQuoteType
public void setQuoteType(Quote.QuoteType value)
Sets the type of quote to use.- Parameters:
value
- the type
-
getQuoteType
public Quote.QuoteType getQuoteType()
Returns the type of quote to use.- Returns:
- the type
-
quoteTypeTipText
public String quoteTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setDoubleUp
public void setDoubleUp(boolean value)
Sets whether to un-double up internal quotes rather than un-escaping with backslash.- Parameters:
value
- true if to double up
-
getDoubleUp
public boolean getDoubleUp()
Returns whether to un-double up internal quotes rather than un-escaping with backslash.- Returns:
- true if to double up
-
doubleUpTipText
public String doubleUpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractConversion
- Returns:
- null if no info available, otherwise short string
-
doConvert
protected Object doConvert() throws Exception
Performs the actual conversion.- Specified by:
doConvert
in classAbstractConversion
- Returns:
- the converted data
- Throws:
Exception
- if something goes wrong with the conversion
-
-