Package adams.flow.processor
Class ChangePath
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<ActorProcessor>,SizeOfHandler,ActorProcessor,ModifyingProcessor,Serializable,Comparable<ActorProcessor>
public class ChangePath extends AbstractModifyingProcessor
Processor that updates paths of classes that are derived fromFile.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]m_ActualNewPaththe actual new path(s).protected BaseString[]m_NewPaththe new path(s).protected BaseString[]m_OldPaththe old path(s).protected booleanm_OldPathIsRegExpwhether the old path is a regular expression.protected BaseString[]m_OldPathLinuxthe old path (with forward slashes).protected booleanm_UseLowerCasewhether to use lowercase for matching.-
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 ChangePath()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckData(Actor actor)The default implementation only checks whether there is any actor set.voiddefineOptions()Adds options to the internal list of options.BaseString[]getNewPath()Returns the new Path to replace with.BaseString[]getOldPath()Returns the old paths to replace.booleangetOldPathIsRegExp()Returns whether the old Path represents a regular expression.booleangetUseLowerCase()Returns whether to lowercase the paths before matching.StringglobalInfo()Returns a string describing the object.StringnewPathTipText()Returns the tip text for this property.StringoldPathIsRegExpTipText()Returns the tip text for this property.StringoldPathTipText()Returns the tip text for this property.protected voidprocessActor(Actor actor)Performs the actual processing.voidsetNewPath(BaseString[] value)Sets the new paths to replace with.voidsetOldPath(BaseString[] value)Sets the old paths to replace.voidsetOldPathIsRegExp(boolean value)Sets whether the old Path represents a regular expression.voidsetUseLowerCase(boolean value)Sets whether to lowercase the paths before matching.StringuseLowerCaseTipText()Returns the tip text for this property.-
Methods inherited from class adams.flow.processor.AbstractModifyingProcessor
getModifiedActor, getNoCopy, initialize, isModified, process, setNoCopy
-
Methods inherited from class adams.flow.processor.AbstractActorProcessor
addError, addError, 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
-
-
-
-
Field Detail
-
m_OldPath
protected BaseString[] m_OldPath
the old path(s).
-
m_OldPathLinux
protected BaseString[] m_OldPathLinux
the old path (with forward slashes).
-
m_OldPathIsRegExp
protected boolean m_OldPathIsRegExp
whether the old path is a regular expression.
-
m_UseLowerCase
protected boolean m_UseLowerCase
whether to use lowercase for matching.
-
m_NewPath
protected BaseString[] m_NewPath
the new path(s).
-
m_ActualNewPath
protected String[] m_ActualNewPath
the actual new path(s).
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setOldPath
public void setOldPath(BaseString[] value)
Sets the old paths to replace.- Parameters:
value- the old paths
-
getOldPath
public BaseString[] getOldPath()
Returns the old paths to replace.- Returns:
- the old paths
-
oldPathTipText
public String oldPathTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setOldPathIsRegExp
public void setOldPathIsRegExp(boolean value)
Sets whether the old Path represents a regular expression.- Parameters:
value- true if the old Path is a regular expression
-
getOldPathIsRegExp
public boolean getOldPathIsRegExp()
Returns whether the old Path represents a regular expression.- Returns:
- true if the old Path is a regular expression
-
oldPathIsRegExpTipText
public String oldPathIsRegExpTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setUseLowerCase
public void setUseLowerCase(boolean value)
Sets whether to lowercase the paths before matching.- Parameters:
value- true if to lowercase paths
-
getUseLowerCase
public boolean getUseLowerCase()
Returns whether to lowercase the paths before matching.- Returns:
- true if to lowercase paths
-
useLowerCaseTipText
public String useLowerCaseTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setNewPath
public void setNewPath(BaseString[] value)
Sets the new paths to replace with.- Parameters:
value- the new paths
-
getNewPath
public BaseString[] getNewPath()
Returns the new Path to replace with.- Returns:
- the new Path
-
newPathTipText
public String newPathTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
checkData
protected void checkData(Actor actor)
The default implementation only checks whether there is any actor set.- Overrides:
checkDatain classAbstractActorProcessor- Parameters:
actor- the actor to process
-
processActor
protected void processActor(Actor actor)
Performs the actual processing.- Specified by:
processActorin classAbstractActorProcessor- Parameters:
actor- the actor to process (is a copy of original for processors implementing ModifyingProcessor)- See Also:
ModifyingProcessor
-
-