Package adams.data.id
Class IDGeneratorPostProcessor
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.id.AbstractIDGenerator
-
- adams.data.id.IDGeneratorPostProcessor
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter
,SizeOfHandler
,Serializable
,Comparable
public class IDGeneratorPostProcessor extends AbstractIDGenerator
A simple ID generator that can make use of data provided by classes implementing IDHandler and DatabaseIDHandler.
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-generator <adams.data.id.AbstractIDGenerator [options]> (property: generator) The generator to use for generating the IDs. default: adams.data.id.SimpleIDGenerator
-find <java.lang.String> (property: find) The string to find (a regular expression). default: find
-replace <java.lang.String> (property: replace) The string to replace the occurrences with. default:
-all (property: replaceAll) If set to true, then all occurrences will be replaced; otherwise only the first.
-placeholder (property: replaceContainsPlaceholder) Set this to true to enable automatic placeholder expansion for the replacement string.
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_Find
the string to find (regexp).protected AbstractIDGenerator
m_Generator
the generator for generating the ID.protected String
m_Replace
the replacement string.protected boolean
m_ReplaceAll
whether to replace all or only the first occurrence.protected boolean
m_ReplaceContainsPlaceholder
whether the replace string contains a placeholder, which needs to be expanded first.-
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 IDGeneratorPostProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
assemble(Object o)
Generates the actual ID.void
defineOptions()
Adds options to the internal list of options.String
findTipText()
Returns the tip text for this property.String
generatorTipText()
Returns the tip text for this property.String
getFind()
Returns the string to find (regular expression).AbstractIDGenerator
getGenerator()
Returns the generator in use.String
getReplace()
Returns the string to replace the occurences with.boolean
getReplaceAll()
Returns whether all occurrences are replaced or only the first one.boolean
getReplaceContainsPlaceholder()
Returns whether the replace string contains a placeholder which needs to be expanded first.String
globalInfo()
Returns a string describing the object.String
replaceAllTipText()
Returns the tip text for this property.String
replaceContainsPlaceholderTipText()
Returns the tip text for this property.String
replaceTipText()
Returns the tip text for this property.void
setFind(String value)
Sets the string to find (regular expression).void
setGenerator(AbstractIDGenerator value)
Sets the generator to use.void
setReplace(String value)
Sets the string to replace the occurrences with.void
setReplaceAll(boolean value)
Sets whether all occurrences are replaced or only the first.void
setReplaceContainsPlaceholder(boolean value)
Sets whether the replace string contains a placeholder which needs to be expanded first.-
Methods inherited from class adams.data.id.AbstractIDGenerator
check, compareTo, equals, generate, postProcess, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Generator
protected AbstractIDGenerator m_Generator
the generator for generating the ID.
-
m_Find
protected String m_Find
the string to find (regexp).
-
m_Replace
protected String m_Replace
the replacement string.
-
m_ReplaceAll
protected boolean m_ReplaceAll
whether to replace all or only the first occurrence.
-
m_ReplaceContainsPlaceholder
protected boolean m_ReplaceContainsPlaceholder
whether the replace string contains a placeholder, which needs to be expanded first.
-
-
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
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setGenerator
public void setGenerator(AbstractIDGenerator value)
Sets the generator to use.- Parameters:
value
- the generator
-
getGenerator
public AbstractIDGenerator getGenerator()
Returns the generator in use.- Returns:
- the generator
-
generatorTipText
public String generatorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setFind
public void setFind(String value)
Sets the string to find (regular expression).- Parameters:
value
- the string
-
getFind
public String getFind()
Returns the string to find (regular expression).- Returns:
- the string
-
findTipText
public String findTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setReplace
public void setReplace(String value)
Sets the string to replace the occurrences with.- Parameters:
value
- the string
-
getReplace
public String getReplace()
Returns the string to replace the occurences with.- Returns:
- the 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.
-
setReplaceAll
public void setReplaceAll(boolean value)
Sets whether all occurrences are replaced or only the first.- Parameters:
value
- true if all are to be replaced, false if only the first
-
getReplaceAll
public boolean getReplaceAll()
Returns whether all occurrences are replaced or only the first one.- Returns:
- true if all are to be replaced, false if only the first
-
replaceAllTipText
public String replaceAllTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setReplaceContainsPlaceholder
public void setReplaceContainsPlaceholder(boolean value)
Sets whether the replace string contains a placeholder which needs to be expanded first.- Parameters:
value
- true if replace string contains a placeholder
-
getReplaceContainsPlaceholder
public boolean getReplaceContainsPlaceholder()
Returns whether the replace string contains a placeholder which needs to be expanded first.- Returns:
- true if replace string contains a placeholder
-
replaceContainsPlaceholderTipText
public String replaceContainsPlaceholderTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
assemble
protected String assemble(Object o)
Generates the actual ID.- Specified by:
assemble
in classAbstractIDGenerator
- Parameters:
o
- the object to generate the ID for- Returns:
- the generated ID
-
-