|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.bind.api.impl.NameUtil
class NameUtil
Methods that convert strings into various formats.
What JAX-RPC name binding tells us is that even such basic method like "isLetter" can be different depending on the situation. For this reason, a whole lot of methods are made non-static, even though they look like they should be static.
Field Summary | |
---|---|
protected static int |
DIGIT
|
protected static int |
LOWER_LETTER
|
protected static int |
OTHER
|
protected static int |
OTHER_LETTER
|
protected static int |
UPPER_LETTER
|
Constructor Summary | |
---|---|
NameUtil()
|
Method Summary | |
---|---|
String |
capitalize(String s)
Capitalizes the first character of the specified string, and de-capitalize the rest of characters. |
protected int |
classify(char c0)
Classify a character into 5 categories that determine the word break. |
static void |
escape(StringBuilder sb,
String s,
int start)
Escapes characters is the given string so that they can be printed by only using US-ASCII characters. |
protected static boolean |
isDigit(char c)
|
static boolean |
isJavaIdentifier(String s)
Checks if a given string is usable as a Java identifier. |
static boolean |
isJavaPackageName(String s)
Checks if the given string is a valid Java package name. |
protected boolean |
isLetter(char c)
|
protected static boolean |
isLower(char c)
|
protected boolean |
isPunct(char c)
|
protected static boolean |
isUpper(char c)
|
String |
toConstantName(List<String> ss)
Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF". |
String |
toConstantName(String s)
Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF". |
protected String |
toMixedCaseName(List<String> ss,
boolean startUpper)
|
protected String |
toMixedCaseVariableName(String[] ss,
boolean startUpper,
boolean cdrUpper)
|
List<String> |
toWordList(String s)
Tokenizes a string into words and capitalizes the first character of each word. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int UPPER_LETTER
protected static final int LOWER_LETTER
protected static final int OTHER_LETTER
protected static final int DIGIT
protected static final int OTHER
Constructor Detail |
---|
NameUtil()
Method Detail |
---|
protected boolean isPunct(char c)
protected static boolean isDigit(char c)
protected static boolean isUpper(char c)
protected static boolean isLower(char c)
protected boolean isLetter(char c)
public String capitalize(String s)
protected int classify(char c0)
public List<String> toWordList(String s)
This method uses a change in character type as a splitter of two words. For example, "abc100ghi" will be splitted into {"Abc", "100","Ghi"}.
protected String toMixedCaseName(List<String> ss, boolean startUpper)
protected String toMixedCaseVariableName(String[] ss, boolean startUpper, boolean cdrUpper)
public String toConstantName(String s)
public String toConstantName(List<String> ss)
public static void escape(StringBuilder sb, String s, int start)
sb
- StringBuffer that receives escaped string.s
- String to be escaped. s.substring(start)
will be escaped and copied to the string buffer.public static boolean isJavaIdentifier(String s)
public static boolean isJavaPackageName(String s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |