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_ActualNewPath
the actual new path(s).protected BaseString[]
m_NewPath
the new path(s).protected BaseString[]
m_OldPath
the old path(s).protected boolean
m_OldPathIsRegExp
whether the old path is a regular expression.protected BaseString[]
m_OldPathLinux
the old path (with forward slashes).protected boolean
m_UseLowerCase
whether 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 void
checkData(Actor actor)
The default implementation only checks whether there is any actor set.void
defineOptions()
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.boolean
getOldPathIsRegExp()
Returns whether the old Path represents a regular expression.boolean
getUseLowerCase()
Returns whether to lowercase the paths before matching.String
globalInfo()
Returns a string describing the object.String
newPathTipText()
Returns the tip text for this property.String
oldPathIsRegExpTipText()
Returns the tip text for this property.String
oldPathTipText()
Returns the tip text for this property.protected void
processActor(Actor actor)
Performs the actual processing.void
setNewPath(BaseString[] value)
Sets the new paths to replace with.void
setOldPath(BaseString[] value)
Sets the old paths to replace.void
setOldPathIsRegExp(boolean value)
Sets whether the old Path represents a regular expression.void
setUseLowerCase(boolean value)
Sets whether to lowercase the paths before matching.String
useLowerCaseTipText()
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:
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
-
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:
checkData
in classAbstractActorProcessor
- Parameters:
actor
- the actor to process
-
processActor
protected void processActor(Actor actor)
Performs the actual processing.- Specified by:
processActor
in classAbstractActorProcessor
- Parameters:
actor
- the actor to process (is a copy of original for processors implementing ModifyingProcessor)- See Also:
ModifyingProcessor
-
-