|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.ConsoleObject
adams.core.option.AbstractOptionHandler
adams.flow.core.AbstractActor
adams.flow.transformer.AbstractTransformer
adams.flow.transformer.SpreadSheetReplaceCellValue
public class SpreadSheetReplaceCellValue
Replaces cell values that match a regular expression with a predefined value.
Input/output:-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
-name <java.lang.String> (property: name) The name of the actor. default: SpreadSheetReplaceCellValue
-annotation <adams.core.base.BaseText> (property: annotations) The annotations to attach to this actor. default:
-skip (property: skip) If set to true, transformation is skipped and the input token is just forwarded as it is.
-stop-flow-on-error (property: stopFlowOnError) If set to true, the flow gets stopped in case this actor encounters an error; useful for critical actors.
-find <adams.core.base.BaseRegExp> (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.
-variable (property: replaceContainsVariable) Set this to true to enable automatic variable expansion for the replacement string.
-scope <DATA_ONLY|HEADER_ONLY|HEADER_AND_DATA> (property: scope) Determines the scope of the find/replace action. default: DATA_ONLY
| Nested Class Summary | |
|---|---|
static class |
SpreadSheetReplaceCellValue.Scope
Defines the scope of the replace. |
| Field Summary | |
|---|---|
static String |
BACKUP_ACTUALREPLACE
the key for storing the current actual replace in the backup. |
protected String |
m_ActualReplace
the actual replacement string (after optional placeholder expansion). |
protected BaseRegExp |
m_Find
the string to find. |
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. |
protected boolean |
m_ReplaceContainsVariable
whether the replace string contains a variable, which needs to be expanded first. |
protected SpreadSheetReplaceCellValue.Scope |
m_Scope
the scope of the replace. |
| Fields inherited from class adams.flow.transformer.AbstractTransformer |
|---|
BACKUP_INPUT, BACKUP_OUTPUT, m_InputToken, m_OutputToken |
| Fields inherited from class adams.flow.core.AbstractActor |
|---|
FILE_EXTENSION, FILE_EXTENSION_GZ, m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_FullName, m_Headless, m_Name, m_Parent, m_Root, m_Self, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated |
| Fields inherited from class adams.core.option.AbstractOptionHandler |
|---|
m_DebugLevel, m_OptionManager |
| Constructor Summary | |
|---|---|
SpreadSheetReplaceCellValue()
|
|
| Method Summary | |
|---|---|
Class[] |
accepts()
Returns the class that the consumer accepts. |
protected Hashtable<String,Object> |
backupState()
Backs up the current state of the actor before update the variables. |
void |
defineOptions()
Adds options to the internal list of options. |
protected String |
doExecute()
Executes the flow item. |
String |
findTipText()
Returns the tip text for this property. |
Class[] |
generates()
Returns the class of objects that it generates. |
BaseRegExp |
getFind()
Returns the string to find (regular expression). |
String |
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI. |
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. |
boolean |
getReplaceContainsVariable()
Returns whether the replace string contains a variable which needs to be expanded first. |
SpreadSheetReplaceCellValue.Scope |
getScope()
Returns the scope of the replace. |
String |
globalInfo()
Returns a string describing the object. |
protected String |
process(String s)
Processes the string. |
protected void |
pruneBackup()
Removes entries from the backup. |
String |
replaceAllTipText()
Returns the tip text for this property. |
String |
replaceContainsPlaceholderTipText()
Returns the tip text for this property. |
String |
replaceContainsVariableTipText()
Returns the tip text for this property. |
String |
replaceTipText()
Returns the tip text for this property. |
protected void |
restoreState(Hashtable<String,Object> state)
Restores the state of the actor before the variables got updated. |
String |
scopeTipText()
Returns the tip text for this property. |
void |
setFind(BaseRegExp value)
Sets the string to find (regular expression). |
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. |
void |
setReplaceContainsVariable(boolean value)
Sets whether the replace string contains a variable which needs to be expanded first. |
void |
setScope(SpreadSheetReplaceCellValue.Scope value)
Sets the scope of the replace. |
String |
setUp()
Initializes the item for flow execution. |
| Methods inherited from class adams.flow.transformer.AbstractTransformer |
|---|
execute, hasPendingOutput, input, output, postExecute, reset, wrapUp |
| Methods inherited from class adams.core.option.AbstractOptionHandler |
|---|
cleanUpOptions, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString |
| Methods inherited from class adams.core.ConsoleObject |
|---|
getDebugging, getSystemErr, getSystemOut |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String BACKUP_ACTUALREPLACE
protected BaseRegExp m_Find
protected String m_Replace
protected String m_ActualReplace
protected boolean m_ReplaceAll
protected boolean m_ReplaceContainsPlaceholder
protected boolean m_ReplaceContainsVariable
protected SpreadSheetReplaceCellValue.Scope m_Scope
| Constructor Detail |
|---|
public SpreadSheetReplaceCellValue()
| Method Detail |
|---|
public String globalInfo()
globalInfo in class AbstractOptionHandlerpublic void defineOptions()
defineOptions in interface OptionHandlerdefineOptions in class AbstractActorpublic String getQuickInfo()
getQuickInfo in interface QuickInfoSupportergetQuickInfo in class AbstractActorpublic void setFind(BaseRegExp value)
value - the stringpublic BaseRegExp getFind()
public String findTipText()
public void setReplace(String value)
value - the stringpublic String getReplace()
public String replaceTipText()
public void setReplaceAll(boolean value)
value - true if all are to be replaced, false if only the firstpublic boolean getReplaceAll()
public String replaceAllTipText()
public void setReplaceContainsPlaceholder(boolean value)
value - true if replace string contains a placeholderpublic boolean getReplaceContainsPlaceholder()
public String replaceContainsPlaceholderTipText()
public void setReplaceContainsVariable(boolean value)
value - true if replace string contains a variablepublic boolean getReplaceContainsVariable()
public String replaceContainsVariableTipText()
public void setScope(SpreadSheetReplaceCellValue.Scope value)
value - the scopepublic SpreadSheetReplaceCellValue.Scope getScope()
public String scopeTipText()
protected void pruneBackup()
pruneBackup in class AbstractActorprotected Hashtable<String,Object> backupState()
backupState in class AbstractTransformerprotected void restoreState(Hashtable<String,Object> state)
restoreState in class AbstractTransformerstate - the backup of the state to restore frompublic String setUp()
setUp in class AbstractActorpublic Class[] accepts()
public Class[] generates()
protected String process(String s)
s - the string to process
protected String doExecute()
doExecute in class AbstractActor
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||