Package adams.flow.processor
Class UpdateEventName
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<ActorProcessor>
,SizeOfHandler
,ActorProcessor
,ModifyingProcessor
,Serializable
,Comparable<ActorProcessor>
public class UpdateEventName extends AbstractNameUpdater<EventReference>
Updates all occurrences of the old event 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 event name to replace with the new one. default:
-new-name <java.lang.String> (property: newName) The new event 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 UpdateEventName()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected EventReference
getReplacement(EventReference 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(EventReference 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.-
Methods inherited from class adams.flow.processor.AbstractNameUpdater
canProcessClassOptions, canRecurse, canRecurse, createPrefix, defineOptions, getNewName, getOldName, processActor, processArgumentOption, 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<EventReference>
- 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<EventReference>
- 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<EventReference>
- 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<EventReference>
- Parameters:
cls
- the class to check- Returns:
- true if a match
-
isNameMatch
protected boolean isNameMatch(EventReference old, String oldName)
Checks whether the located object matches the old name that requires replacement.- Specified by:
isNameMatch
in classAbstractNameUpdater<EventReference>
- Parameters:
old
- the old object to checkoldName
- the old name to look for- Returns:
- true if a match
-
getReplacement
protected EventReference getReplacement(EventReference old, String newName)
Returns the replacement object.- Specified by:
getReplacement
in classAbstractNameUpdater<EventReference>
- Parameters:
old
- the old objectnewName
- the new name to use- Returns:
- the replacement object, null in case of error
-
-