org.merlotxml.util
Class StringUtil
java.lang.Object
org.merlotxml.util.StringUtil
- public class StringUtil
- extends java.lang.Object
String utilities
- Author:
- Tim McCune
Method Summary |
static java.lang.String |
lookupKeysInString(java.lang.String str,
int recurselvl,
StringUtil.KeyFinder finder)
|
static java.lang.String |
lookupKeysInString(java.lang.String str,
StringUtil.KeyFinder finder)
This looks up {% %} delimted keys in a string and replaces them. |
static boolean |
match(java.lang.String pattern,
java.lang.String input)
Match a file glob style expression without ranges. |
static java.lang.String |
sReplace(java.lang.String search,
java.lang.String replace,
java.lang.String source)
Search a string for all instances of a substring and replace
it with another string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RECURSION_THRESHOLD
public static final int RECURSION_THRESHOLD
- See Also:
- Constant Field Values
StringUtil
public StringUtil()
sReplace
public static java.lang.String sReplace(java.lang.String search,
java.lang.String replace,
java.lang.String source)
- Search a string for all instances of a substring and replace
it with another string. Amazing that this is not a method
of java.lang.String since I use it all the time.
- Parameters:
search
- Substring to search forreplace
- String to replace it withsource
- String to search through
- Returns:
- The source with all instances of
search
replaced by replace
match
public static boolean match(java.lang.String pattern,
java.lang.String input)
- Match a file glob style expression without ranges.
'*' matches zero or more chars.
'?' matches any single char.
- Parameters:
pattern
- A glob-style pattern to matchinput
- The string to match
- Returns:
- whether or not the string matches the pattern.
lookupKeysInString
public static java.lang.String lookupKeysInString(java.lang.String str,
StringUtil.KeyFinder finder)
- This looks up {% %} delimted keys in a string and replaces them. This
is used by resource catalog, TreeConfig, and several other components.
lookupKeysInString
public static java.lang.String lookupKeysInString(java.lang.String str,
int recurselvl,
StringUtil.KeyFinder finder)