Package adams.flow.processor
Class UpdateStorageName
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<ActorProcessor>
,SizeOfHandler
,ActorProcessor
,ModifyingProcessor
,Serializable
,Comparable<ActorProcessor>
public class UpdateStorageName extends AbstractNameUpdater<StorageName>
Updates all occurrences of the old storage name with the new one.
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
-old-name <java.lang.String> (property: oldName) The old storage name to replace with the new one. default:
-new-name <java.lang.String> (property: newName) The new storage name that replaces the old one. default:
- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class adams.flow.processor.AbstractNameUpdater
m_NewName, m_OldName
-
Fields inherited from class adams.flow.processor.AbstractModifyingProcessor
m_Modified, m_ModifiedActor, m_NoCopy
-
Fields inherited from class adams.flow.processor.AbstractActorProcessor
m_Errors
-
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 UpdateStorageName()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRecurse(Class cls)
Returns whether the traverser can recurse the specified class (base class from a ClassOption).protected StorageName
getReplacement(StorageName old, String newName)
Returns the replacement object.String
globalInfo()
Returns a string describing the object.protected boolean
isBaseClassMatch(Class cls)
Returns whether the base class that we're looking for to perform the replacement on is a match.protected boolean
isNameMatch(StorageName old, String oldName)
Checks whether the located object matches the old name that requires replacement.String
newNameTipText()
Returns the tip text for this property.String
oldNameTipText()
Returns the tip text for this property.protected void
processArgumentOption(AbstractArgumentOption option)
Processes the specified argument option.protected boolean
processBaseObject(AbstractArgumentOption option)
Updates storage names in BaseObject derived values.-
Methods inherited from class adams.flow.processor.AbstractNameUpdater
canProcessClassOptions, canRecurse, createPrefix, defineOptions, getNewName, getOldName, processActor, setNewName, setOldName
-
Methods inherited from class adams.flow.processor.AbstractModifyingProcessor
getModifiedActor, getNoCopy, initialize, isModified, process, setNoCopy
-
Methods inherited from class adams.flow.processor.AbstractActorProcessor
addError, addError, checkData, compareTo, equals, getErrors, hasErrors, reset, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.flow.processor.ActorProcessor
compareTo, getErrors, hasErrors, shallowCopy, shallowCopy
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractNameUpdater<StorageName>
- Returns:
- a description suitable for displaying in the gui
-
oldNameTipText
public String oldNameTipText()
Returns the tip text for this property.- Specified by:
oldNameTipText
in classAbstractNameUpdater<StorageName>
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
newNameTipText
public String newNameTipText()
Returns the tip text for this property.- Specified by:
newNameTipText
in classAbstractNameUpdater<StorageName>
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
isBaseClassMatch
protected boolean isBaseClassMatch(Class cls)
Returns whether the base class that we're looking for to perform the replacement on is a match.- Specified by:
isBaseClassMatch
in classAbstractNameUpdater<StorageName>
- Parameters:
cls
- the class to check- Returns:
- true if a match
-
canRecurse
public boolean canRecurse(Class cls)
Returns whether the traverser can recurse the specified class (base class from a ClassOption).
Does not recurse intoLocalScopeTrigger
andFlow
actors.- Overrides:
canRecurse
in classAbstractNameUpdater<StorageName>
- Parameters:
cls
- the class to determine for whether recursing is possible or not- Returns:
- true if to traverse the options recursively
-
isNameMatch
protected boolean isNameMatch(StorageName old, String oldName)
Checks whether the located object matches the old name that requires replacement.- Specified by:
isNameMatch
in classAbstractNameUpdater<StorageName>
- Parameters:
old
- the old object to checkoldName
- the old name to look for- Returns:
- true if a match
-
getReplacement
protected StorageName getReplacement(StorageName old, String newName)
Returns the replacement object.- Specified by:
getReplacement
in classAbstractNameUpdater<StorageName>
- Parameters:
old
- the old objectnewName
- the new name to use- Returns:
- the replacement object, null in case of error
-
processBaseObject
protected boolean processBaseObject(AbstractArgumentOption option)
Updates storage names in BaseObject derived values.- Parameters:
option
- the option to process- Returns:
- true if modified
-
processArgumentOption
protected void processArgumentOption(AbstractArgumentOption option)
Processes the specified argument option.- Overrides:
processArgumentOption
in classAbstractNameUpdater<StorageName>
- Parameters:
option
- the option to process
-
-