|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.alicebot.server.core.util.Substituter
public class Substituter
Provides generic substitution utilities for classes that don't have their own.
Constructor Summary | |
---|---|
Substituter()
|
Method Summary | |
---|---|
static java.lang.String |
applySubstitutions(java.util.HashMap substitutionMap,
java.lang.String input)
Same as replaceIgnoreCase(java.lang.String, java.lang.String, java.lang.String) except a substitution map is given,
and extra care is taken to ensure that a replaced value does not
have further substitutions performed on it. |
static java.lang.String |
replace(java.lang.String find,
java.lang.String replace,
java.lang.String input)
Replaces all instances of find
with replace . |
static java.lang.String |
replaceIgnoreCase(java.lang.String find,
java.lang.String replace,
java.lang.String input)
Same as replace(java.lang.String, java.lang.String, java.lang.String) except case is ignored. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Substituter()
Method Detail |
---|
public static java.lang.String replace(java.lang.String find, java.lang.String replace, java.lang.String input)
Replaces all instances of find
with replace
.
NB: This method does not take care that
further substitutions are not performed on replaced text.
For this extra caution, use applySubstitutions(java.util.HashMap, java.lang.String)
.
input
- the string on which to perform the replacementfind
- the string to findreplace
- the string with which to replace it
public static java.lang.String replaceIgnoreCase(java.lang.String find, java.lang.String replace, java.lang.String input)
Same as replace(java.lang.String, java.lang.String, java.lang.String)
except case is ignored.
NB: This method does not take care that
further substitutions are not performed on replaced text.
For this extra caution, use applySubstitutions(java.util.HashMap, java.lang.String)
.
input
- the string on which to perform the replacementfind
- the string to findreplace
- the string with which to replace it
public static java.lang.String applySubstitutions(java.util.HashMap substitutionMap, java.lang.String input)
replaceIgnoreCase(java.lang.String, java.lang.String, java.lang.String)
except a substitution map is given,
and extra care is taken to ensure that a replaced value does not
have further substitutions performed on it.
substitutionMap
- the map of substitutions to be performedinput
- the string on which to perform the replacement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |