|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.common.string.StringReplacer
public class StringReplacer
Utility class that replaces patterns in a string with replacement strings. Supports case-insensitive replacements. Also optionally trims spaces inside the string.
| Constructor Summary | |
|---|---|
StringReplacer()
Constructor. |
|
| Method Summary | |
|---|---|
void |
addReplacement(java.lang.String pattern,
java.lang.String replacement)
Adds a pattern to the replacer. |
java.lang.String |
process(java.lang.String s)
Performs the processing. |
void |
setIgnoreCase(boolean ignoreCase)
Sets the ignore case option. |
void |
setTrim(boolean trim)
Sets the trim mode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringReplacer()
| Method Detail |
|---|
public void addReplacement(java.lang.String pattern,
java.lang.String replacement)
pattern - The patternreplacement - The substitute that will replace the pattern in the string
or null to remove the pattern from the stringpublic void setIgnoreCase(boolean ignoreCase)
ignoreCase - true The character case will be ignored when comparing strings.public void setTrim(boolean trim)
trim - true Removes overflous spaces and newlines, i. e. skips succeeding
newslines and spacespublic java.lang.String process(java.lang.String s)
s - String to process
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||