|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.uima.pear.util.StringUtil
public class StringUtil
The StringUtil
class provides utility methods for working with strings.
Constructor Summary | |
---|---|
StringUtil()
|
Method Summary | |
---|---|
static Properties |
appendProperties(Properties source,
Properties plus,
boolean override)
Appends properties specified in a given 'plus' object to a given 'source' object. |
static int |
countWords(String text)
|
static String |
errorStackTraceContent(Throwable error)
Return the content of the stack trace for a given Throwable object. |
static String |
extractTextFromMarkup(String mString)
|
static String |
getPlainClassName(Class<?> aClass)
Returns a plain name (without package name) of a given Java Class . |
static int |
indexOfIgnoreCase(String mainStr,
String argStr)
|
static int |
indexOfIgnoreCase(String mainStr,
String argStr,
int fromIndex)
|
static boolean |
isLowerCase(String string)
|
static boolean |
isUpperCase(String string)
|
static String |
toRegExpReplacement(String string)
Converts a given input string to another string that can be used as a 'replacement' string in the String::replaceAll(String regex, String replacement) method. |
static String |
toRegExpString(String string)
Converts a given input string to another string that can be used in all 'reqular expression' methods. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringUtil()
Method Detail |
---|
public static Properties appendProperties(Properties source, Properties plus, boolean override)
true
, the 'plus' properties will override the 'source'
properties with the same name, otherwise the 'source' properties will stay.
source
- The given 'source' properties object.plus
- The given 'plus' properties object.override
- If this flag is true
, the 'plus' properties will override the 'source'
properties with the same name, otherwise the 'source' properties will stay.
public static int countWords(String text)
text
- The given string.
public static String errorStackTraceContent(Throwable error)
Throwable
object.
error
- The given Throwable
object.
public static String extractTextFromMarkup(String mString)
mString
- The given markup string.
public static String getPlainClassName(Class<?> aClass)
Class
.
aClass
- The given Java Class
.
Class
.public static boolean isLowerCase(String string)
string
- The given string.
true
, if all characters in a given string are lowercase letters,
false
otherwise.public static boolean isUpperCase(String string)
string
- The given string.
true
, if all characters in a given string are uppercase letters,
false
otherwise.public static int indexOfIgnoreCase(String mainStr, String argStr)
mainStr
- The given string object.argStr
- The given string argument.
-1
is returned.public static int indexOfIgnoreCase(String mainStr, String argStr, int fromIndex)
mainStr
- The given string object.argStr
- The given string argument.fromIndex
- The index to start the search from.
fromIndex
, then the
index of the first character of the first such substring is returned; if it does not
occur as a substring starting at fromIndex
or beyond, -1
is returned.public static String toRegExpReplacement(String string)
String::replaceAll(String regex, String replacement)
method.
string
- The given input string.
String::replaceAll(String regex, String replacement)
method.public static String toRegExpString(String string)
string
- The given input string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |