flux
Interface RegularExpressionAction

All Superinterfaces:
Action, java.lang.Cloneable, RuntimeDataMap, java.io.Serializable

public interface RegularExpressionAction
extends Action

Searches for strings in a file or an input string that match a regular expression. Optionally, within the search results, the first or all of those matching strings can be replaced with a different string. The file contents and the input string are not modified. The result lists the matching strings, optionally replaced by different strings. If both the replaceFirst and replaceAll properties have been set on this action, the first matching string is replaced by the replaceFirst property and the remaining matching strings are replaced by the replaceAll property.

The Regular Expression Action returns its result in the flow context variable "RESULT". The following table contains more information on accessing and using the result.

Flow Context Variable Field Java Type Description
RESULTmatchedbooleanA boolean indicating whether the regular expression pattern was found in the input content.
RESULTendintThe 0-based index of the last character matched of the input.
RESULTgroupCountintThe number of matches found.
RESULTgroupsjava.lang.String[]The input sequences matched by the regular expression pattern. If the replaceFirst and / or replaceAll properties are used, this result will contain the replaced text.
RESULTstartintThe 0-based location of the first occurrence of the regular expression matched in the input file or input string.
RESULTreplacedintThe input, with groups matched by the regular expression pattern replaced by the replaceFirst and replaceAll properties. ignored. If replaceFirst is used, only the first matching group is replaced.

Author:
Copyright 2014 Flux Corporation. All rights reserved.

Nested Class Summary
static class RegularExpressionAction.RegularExpressionActionResult
          The result when a RegularExpressionAction runs.
 
Method Summary
 java.lang.String getInput()
          Returns the input string content that the regular expression will test.
 java.lang.String getInputFilename()
          Returns the name of the input file that the regular expression will test.
 java.lang.String getPattern()
          Returns the regular expression against which the input string or file contents will be tested.
 java.lang.String getReplaceAll()
          Returns the content that will replace all occurrences of the regular expression in the input file or input string.
 java.lang.String getReplaceFirst()
          Returns the content that will replace the first occurrence of the regular expression in the input file or input string.
 void setInput(java.lang.String input)
          Sets the input string content which the regular expression will test.
 void setInputFilename(java.lang.String filename)
          Sets the name of the input file which the regular expression will test.
 void setPattern(java.lang.String pattern)
          Sets the regular expression against which the input file or input string will be tested.
 void setReplaceAll(java.lang.String value)
          Sets the content that will replace all occurrences of the regular expression in the input file or input string.
 void setReplaceFirst(java.lang.String value)
          Sets the content that will replace the first occurrence of the regular expression in the input file or input string.
 
Methods inherited from interface flux.Action
addFlow, addFlow, addSignalFlow, clone, execute, getDescription, getFlows, getHiddenVariableNames, getJoinExpression, getName, getPostscript, getPostscriptLanguage, getPrescript, getPrescriptLanguage, getResultInfo, getSignalsToMonitor, getTimeoutBusinessInterval, getTimeoutBusinessIntervalNamespace, getTimeoutExpression, getVariableManager, isEndOfRun, isJoinPoint, isSkippable, isStartAction, isStartOfRun, isTransactionBreak, removeFlow, reset, setDescription, setElseFlow, setEndOfRun, setErrorFlow, setErrorFlowWithoutRollback, setErrorFlowWithRollback, setJoinExpression, setJoinPoint, setName, setPostscript, setPostscriptLanguage, setPrescript, setPrescriptLanguage, setSignalsToMonitor, setSkippable, setStartAction, setStartOfRun, setTimeoutBusinessInterval, setTimeoutBusinessIntervalNamespace, setTimeoutExpression, setTimeoutFlow, setTransactionBreak, verify, verifyOnClient
 
Methods inherited from interface flux.runtimedatamap.RuntimeDataMap
getRuntimeDataMap, setRuntimeDataMap
 

Method Detail

getInput

java.lang.String getInput()
Returns the input string content that the regular expression will test.

Returns:
The input string content that the regular expression will test.

getInputFilename

java.lang.String getInputFilename()
Returns the name of the input file that the regular expression will test.

Returns:
The name of the input file that the regular expression will test.

getPattern

java.lang.String getPattern()
Returns the regular expression against which the input string or file contents will be tested.

Returns:
The regular expression against which the input string or file contents will be tested.

getReplaceAll

java.lang.String getReplaceAll()
Returns the content that will replace all occurrences of the regular expression in the input file or input string.

Returns:
The content that will replace all occurrences of the regular expression in the input file or input string.

getReplaceFirst

java.lang.String getReplaceFirst()
Returns the content that will replace the first occurrence of the regular expression in the input file or input string.

Returns:
The content that will replace the first occurrence of the regular expression in the input file or input string.

setInput

void setInput(java.lang.String input)
Sets the input string content which the regular expression will test. It is an error to set both the input and inputFilename properties.

Parameters:
input - The input string content which the regular expression will test.

setInputFilename

void setInputFilename(java.lang.String filename)
Sets the name of the input file which the regular expression will test. It is an error to set both the input and inputFilename properties.

Parameters:
filename - The name of the input file which the regular expression will test.

setPattern

void setPattern(java.lang.String pattern)
Sets the regular expression against which the input file or input string will be tested.

Parameters:
pattern - A regular expression pattern.

setReplaceAll

void setReplaceAll(java.lang.String value)
Sets the content that will replace all occurrences of the regular expression in the input file or input string. If this is set, the replaceFirst property is ignored.

Parameters:
value - The content that will replace all occurrences of the regular expression in the input file or input string.

setReplaceFirst

void setReplaceFirst(java.lang.String value)
Sets the content that will replace the first occurrence of the regular expression in the input file or input string. If the replaceAll property is set, this property is ignored.

Parameters:
value - The content that will replace the first occurrence of the regular expression in the input file or input string.


© 2014 Flux Corporation. All rights reserved.