| java.lang.Object org.apache.axis2.util.JavaUtils
JavaUtils | public class JavaUtils (Code) | | JavaUtils
|
Method Summary | |
public static String | capitalizeFirstChar(String name) Capitalizes the first character of the name. | public static Class | getWrapperClass(Class primitive) | public static boolean | hasUpperCase(String word) | public static int | indexOfIgnoreCase(String string, String search) Scans the parameter string for the parameter search ignoring case when
comparing characters.
Parameters: string - Parameters: search - If test is empty -1 is always returned. | public static boolean | isFalse(String value) | public static boolean | isFalse(Object value, boolean defaultVal) Tests the Object 'value':
if its null, return default. | public static boolean | isFalse(Object value) | public static boolean | isFalseExplicitly(String value) | public static boolean | isFalseExplicitly(Object value, boolean defaultVal) Tests the Object 'value':
if its null, return default. | public static boolean | isFalseExplicitly(Object value) | public static boolean | isJavaId(String id) | public static boolean | isJavaKeyword(String keyword) Checks if the input string is a valid java keyword. | public static boolean | isTrue(String value) | public static boolean | isTrue(Object value, boolean defaultVal) Tests the Object 'value':
if its null, return default. | public static boolean | isTrue(Object value) | public static boolean | isTrueExplicitly(String value) | public static boolean | isTrueExplicitly(Object value, boolean defaultVal) Tests the Object 'value':
if its null, return default. | public static boolean | isTrueExplicitly(Object value) | public static String | makeNonJavaKeyword(String keyword) Turns a java keyword string into a non-Java keyword string. | public static String[] | split(String str, char separatorChar) Splits the provided text into an array, separator specified. | public static String | xmlNameToJava(String name) | public static String | xmlNameToJavaIdentifier(String name) |
EMPTY_STRING_ARRAY | final public static String[] EMPTY_STRING_ARRAY(Code) | | An empty immutable String array.
|
englishCollator | final static Collator englishCollator(Code) | | Collator for comparing the strings
|
keywordPrefix | final static char keywordPrefix(Code) | | Use this character as suffix
|
keywords | final static String keywords(Code) | | These are java keywords as specified at the following URL (sorted alphabetically).
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#229308
Note that false, true, and null are not strictly keywords; they are literal values,
but for the purposes of this array, they can be treated as literals.
PLEASE KEEP THIS LIST SORTED IN ASCENDING ORDER ******
|
capitalizeFirstChar | public static String capitalizeFirstChar(String name)(Code) | | Capitalizes the first character of the name.
Parameters: name - Returns String. |
hasUpperCase | public static boolean hasUpperCase(String word)(Code) | | Check if the word has any uppercase letters
Parameters: word - |
indexOfIgnoreCase | public static int indexOfIgnoreCase(String string, String search)(Code) | | Scans the parameter string for the parameter search ignoring case when
comparing characters.
Parameters: string - Parameters: search - If test is empty -1 is always returned. -1 if the string was not found or the index of the first matchingcharacter |
isFalse | public static boolean isFalse(String value)(Code) | | Tests the String 'value':
return 'true' if its 'false', '0', or 'no' - else 'false'
Follow in 'C' tradition of boolean values:
false is specific (0), everything else is true;
|
isFalse | public static boolean isFalse(Object value, boolean defaultVal)(Code) | | Tests the Object 'value':
if its null, return default.
if its a Boolean, return booleanValue()
if its an Integer, return 'false' if its '0' else 'true'
if its a String, return 'false' if its 'false', 'no', or '0' - else 'true'
All other types return 'true'
|
isFalseExplicitly | public static boolean isFalseExplicitly(String value)(Code) | | Tests the String 'value':
return 'true' if its null, 'false', '0', or 'no' - else 'false'
|
isFalseExplicitly | public static boolean isFalseExplicitly(Object value, boolean defaultVal)(Code) | | Tests the Object 'value':
if its null, return default.
if its a Boolean, return !booleanValue()
if its an Integer, return 'true' if its '0' else 'false'
if its a String, return isFalseExplicitly((String)value).
All other types return 'false'
|
isFalseExplicitly | public static boolean isFalseExplicitly(Object value)(Code) | | |
isJavaKeyword | public static boolean isJavaKeyword(String keyword)(Code) | | Checks if the input string is a valid java keyword.
Returns boolean. |
isTrue | public static boolean isTrue(String value)(Code) | | Tests the String 'value':
return 'false' if its 'false', '0', or 'no' - else 'true'
Follow in 'C' tradition of boolean values:
false is specific (0), everything else is true;
|
isTrue | public static boolean isTrue(Object value, boolean defaultVal)(Code) | | Tests the Object 'value':
if its null, return default.
if its a Boolean, return booleanValue()
if its an Integer, return 'false' if its '0' else 'true'
if its a String, return 'false' if its 'false', 'no', or '0' - else 'true'
All other types return 'true'
|
isTrueExplicitly | public static boolean isTrueExplicitly(String value)(Code) | | Tests the String 'value':
return 'true' if its 'true', '1', or 'yes' - else 'false'
|
isTrueExplicitly | public static boolean isTrueExplicitly(Object value, boolean defaultVal)(Code) | | Tests the Object 'value':
if its null, return default.
if its a Boolean, return booleanValue()
if its an Integer, return 'false' if its '0' else 'true'
if its a String, return isTrueExplicitly((String)value).
All other types return 'true'
|
isTrueExplicitly | public static boolean isTrueExplicitly(Object value)(Code) | | |
makeNonJavaKeyword | public static String makeNonJavaKeyword(String keyword)(Code) | | Turns a java keyword string into a non-Java keyword string. (Right now
this simply means appending an underscore.)
|
split | public static String[] split(String str, char separatorChar)(Code) | | Splits the provided text into an array, separator specified.
This is an alternative to using StringTokenizer.
The separator is not included in the returned String array.
Adjacent separators are treated as one separator.
A null input String returns null .
StringUtils.split(null, *) = null
StringUtils.split("", *) = []
StringUtils.split("a.b.c", '.') = ["a", "b", "c"]
StringUtils.split("a..b.c", '.') = ["a", "b", "c"]
StringUtils.split("a:b:c", '.') = ["a:b:c"]
StringUtils.split("a\tb\nc", null) = ["a", "b", "c"]
StringUtils.split("a b c", ' ') = ["a", "b", "c"]
Parameters: str - the String to parse, may be null Parameters: separatorChar - the character used as the delimiter,null splits on whitespace an array of parsed Strings, null if null String input |
xmlNameToJavaIdentifier | public static String xmlNameToJavaIdentifier(String name)(Code) | | converts an xml name to a java identifier
Parameters: name - java identifier |
|
|