public class SimplePatternAnchorValueAssigner
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
REPLACE_ALL
Replace at all positions.
|
Constructor and Description |
---|
SimplePatternAnchorValueAssigner(java.lang.String content,
java.lang.String anchorPattern,
java.lang.String leftSidePattern,
java.lang.String rightSidePattern,
java.lang.String replaceText,
int replacePosition)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
int |
execute()
Execute the algorithm.
|
java.util.ArrayList<java.lang.String> |
getReplacedTextList()
Get the list of original text-fragments which have been replaced.
|
java.lang.String |
getResultContent()
Get the result content.
|
boolean |
isAnchorFound()
Get if the anchor was found.
|
void |
setSearchReverse(boolean searchReverse)
Set if the algorithm works in reverse order (default: false).
|
public static final int REPLACE_ALL
public SimplePatternAnchorValueAssigner(java.lang.String content, java.lang.String anchorPattern, java.lang.String leftSidePattern, java.lang.String rightSidePattern, java.lang.String replaceText, int replacePosition)
content
- the content in which the value(s) are replacedanchorPattern
- the anchor patternleftSidePattern
- the left side patternrightSidePattern
- the right side patternreplaceText
- the text to set/replace between the left side pattern and the right side patternreplacePosition
- the replace position (1..n) starting from the anchor, or REPLACE_ALLREPLACE_ALL
public void setSearchReverse(boolean searchReverse)
searchReverse
- true = Search in the content from bottom to toppublic int execute()
public java.lang.String getResultContent()
public boolean isAnchorFound()
public java.util.ArrayList<java.lang.String> getReplacedTextList()