org.schmant.support.text
Class StringTextStrategy
java.lang.Object
org.schmant.support.text.StringTextStrategy
- All Implemented Interfaces:
- ReplacementTextStrategy
public class StringTextStrategy
- extends Object
- implements ReplacementTextStrategy
This ReplacementTextStrategy
replaces the matched text with a constant
string value.
- Since:
- 0.8
- Author:
- Karl Gustafsson
- See Also:
CapturingGroupAwareStringTextStrategy
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringTextStrategy
public StringTextStrategy(String replacementString)
- Create a new string text strategy.
- Parameters:
replacementString
- The replacement text.
getReplace
public String getReplace(String text,
Matcher m)
- Description copied from interface:
ReplacementTextStrategy
- Get the replacement text for the supplied text.
- Specified by:
getReplace
in interface ReplacementTextStrategy
- Parameters:
text
- The text.m
- The Matcher
that matches the current text. This object
can only be read from. Its state must not be updated.
- Returns:
- The replacement text.