Package adams.data.conversion
Class AbstractValidateString
-
- All Implemented Interfaces:
AdditionalInformationHandler,CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,ShallowCopySupporter<AbstractConversion>,SizeOfHandler,Stoppable,Conversion,ConversionFromString,ConversionToString,Serializable
- Direct Known Subclasses:
StringToValidFileName,StringToValidStorageName,StringToValidVariableName
public abstract class AbstractValidateString extends AbstractStringConversion
Ancestor for string conversions that ensure a string only contains valid characters according to some rules.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringm_Replacethe replacement string.-
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 AbstractValidateString()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected ObjectdoConvert()Performs the actual conversion.protected StringgetDefaultReplace()Returns the default replacement string.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.StringgetReplace()Returns the replacement string for invalid characters.protected abstract Stringprocess(String input, String replace)Performs the actual validation.StringreplaceTipText()Returns the tip text for this property.voidsetReplace(String value)Sets the replacement string for invalid characters.-
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, globalInfo, 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_Replace
protected String m_Replace
the replacement string.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
getDefaultReplace
protected String getDefaultReplace()
Returns the default replacement string.- Returns:
- the default
-
setReplace
public void setReplace(String value)
Sets the replacement string for invalid characters.- Parameters:
value- the replacement string
-
getReplace
public String getReplace()
Returns the replacement string for invalid characters.- Returns:
- the replacement string
-
replaceTipText
public String replaceTipText()
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:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin classAbstractConversion- Returns:
- null if no info available, otherwise short string
-
process
protected abstract String process(String input, String replace) throws Exception
Performs the actual validation.- Parameters:
input- the input stringreplace- the replacement string for invalide characters- Throws:
Exception
-
doConvert
protected Object doConvert() throws Exception
Performs the actual conversion.- Specified by:
doConvertin classAbstractConversion- Returns:
- the converted data
- Throws:
Exception- if something goes wrong with the conversion
-
-