|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.identityconnectors.common.StringUtil
public class StringUtil
Method Summary | |
---|---|
static boolean |
endsWith(java.lang.String str, char value) Determines if the string parameter 'str' ends with the character value. |
static int |
indexOf(java.lang.String src, char[] ch) |
static int |
indexOf(java.lang.String src, char[] ch, int idx) |
static int |
indexOfDigit(java.lang.String str) Finds the index of the first digit. |
static int |
indexOfDigit(java.lang.String str, int startidx) Finds the index of the first digit and starts from the index specified. |
static int |
indexOfIgnoreCase(java.lang.String src, java.lang.String cmp) Finds the start index of the comparison string regards of case. |
static int |
indexOfNonDigit(java.lang.String str) Finds the index of the first non digit. |
static int |
indexOfNonDigit(java.lang.String str, int startidx) Finds the index of the first non digit and starts from the index specified. |
static boolean |
isBlank(java.lang.String val) StringUtil.isBlank(null) = true StringUtil.isBlank("") = true StringUtil.isBlank(" ") = true StringUtil.isBlank("bob") = false StringUtil.isBlank(" bob ") = false |
static boolean |
isEmpty(java.lang.String val) Determines if a string is empty. |
static boolean |
isNotBlank(java.lang.String val) |
static boolean |
isNotEmpty(java.lang.String val) Determines if a string is not empty. |
static boolean |
isWhitespace(char ch) Determine if this is a white space character. |
static java.util.List<java.lang.String> |
parseLine(java.lang.String line, char fsep, char tqul) Parses a line into a List of strings. |
static java.lang.String |
randomString() Create a random Unicode string. |
static java.lang.String |
randomString(java.util.Random r) Create a random length Unicode string based on the Random object passed in. |
static java.lang.String |
randomString(java.util.Random r, int length) Create a random string of fixed length based on the Random object passed in. |
static java.lang.String |
replaceVariable(java.lang.String o, java.lang.String var, java.lang.String val) Simple variable replacement internally using regular expressions. |
static java.lang.String |
stripNewlines(java.lang.String src) Removes newline characters (0x0a and 0x0d) from a string. |
static java.lang.String |
stripXmlAttribute(java.lang.String src, java.lang.String attrName) Removes the attribute from the source string and returns. |
static java.lang.String |
stripXmlComments(java.lang.String src) Strip XML comments |
static java.lang.String |
subDigitString(java.lang.String str) Return the string of digits from string. |
static java.lang.String |
subDigitString(java.lang.String str, int idx) Return the string of digits from string. |
static java.util.Properties |
toProperties(java.lang.String value) Returns a properties object w/ the key/value pairs parsed from the string passed in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int indexOfDigit(java.lang.String str, int startidx)
str
- String to search for a digit.startidx
- Starting index from which to searchpublic static int indexOfDigit(java.lang.String str)
str
- String to seach for a digit.public static int indexOfNonDigit(java.lang.String str, int startidx)
str
- String to seach for a non digit.startidx
- Starting index from which to search.public static int indexOfNonDigit(java.lang.String str)
str
- String to seach for a non digit.public static java.lang.String subDigitString(java.lang.String str)
str
- Source string to search.public static java.lang.String subDigitString(java.lang.String str, int idx)
str
- Source string to search.idx
- Start index from which to search.public static java.lang.String stripXmlAttribute(java.lang.String src, java.lang.String attrName)
public static java.lang.String stripNewlines(java.lang.String src)
public static int indexOfIgnoreCase(java.lang.String src, java.lang.String cmp)
src
- String to search.cmp
- Comparsion string to find.public static java.lang.String stripXmlComments(java.lang.String src)
public static int indexOf(java.lang.String src, char[] ch)
public static int indexOf(java.lang.String src, char[] ch, int idx)
public static boolean isEmpty(java.lang.String val)
StringUtil.isEmpty(null) = true StringUtil.isEmpty("") = true StringUtil.isEmpty(" ") = false StringUtil.isEmpty("bob") = false StringUtil.isEmpty(" bob ") = false
val
- string to evaluate as empty.public static boolean isNotEmpty(java.lang.String val)
isEmpty(String)
.val
- string to evaluate.public static boolean isBlank(java.lang.String val)
StringUtil.isBlank(null) = true StringUtil.isBlank("") = true StringUtil.isBlank(" ") = true StringUtil.isBlank("bob") = false StringUtil.isBlank(" bob ") = false
public static boolean isNotBlank(java.lang.String val)
public static java.util.Properties toProperties(java.lang.String value)
public static java.lang.String replaceVariable(java.lang.String o, java.lang.String var, java.lang.String val)
String o = "Some string with a ${variable} in it."; String n = replaceVariable(o, "variable", "something"); String r = "Some string with a something in it"; assert r.equals(n);
o
- Original string to do the replacement on.var
- String representation of the variable to replace.val
- Value to replace the variable with.java.lang.IllegalArgumentException
- iff o is null, var is blank, or val is null.public static boolean endsWith(java.lang.String str, char value)
str
- String to check for the character at the end.value
- The character to look for at the end of the string.public static java.util.List<java.lang.String> parseLine(java.lang.String line, char fsep, char tqul)
line
- String to parse.fsep
- Field separatortqul
- Text qualifier.public static boolean isWhitespace(char ch)
public static java.lang.String randomString()
public static java.lang.String randomString(java.util.Random r)
Random
object passed in.public static java.lang.String randomString(java.util.Random r, int length)
Random
object passed in. Insure that the string is built w/ Unicode characters.r
- used to get random unicode characters.length
- fixed length of string.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |