public class NameUtil extends Object
Constructor and Description |
---|
NameUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
capitalize(String s)
Capitalizes the first character of the specified string,
and de-capitalize the rest of characters.
|
static boolean |
equal(String s,
String t)
determine if two Strings are iqual allowing null values
|
static boolean |
equalsIgnoreCase(String s,
String t)
determine if two Strings are equal ignoring case allowing null values
|
static void |
escape(StringBuffer sb,
String s,
int start)
Escapes characters is the given string so that they can be
printed by only using US-ASCII characters.
|
static String |
escapeURI(String s)
Escape any characters that would cause the single arg constructor
of java.net.URI to complain about illegal chars.
|
static String |
getParentUriPath(String uriPath)
Calculate the parent URI path of the given URI path.
|
protected static boolean |
isDigit(char c) |
protected static boolean |
isLetter(char c) |
protected static boolean |
isLower(char c) |
protected static boolean |
isPunct(char c) |
protected static boolean |
isUpper(char c) |
protected static int |
nextBreak(String s,
int start) |
static String |
normalizeUriPath(String uriPath)
Calculate the normalized form of the given uriPath.
|
static String |
toClassName(String s) |
static String |
toConstantName(String s)
Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF".
|
static String |
toConstantName(String[] ss)
Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF".
|
static String |
toInterfaceName(String token) |
static String |
toMethodName(String s) |
protected static String |
toMixedCaseName(String[] ss,
boolean startUpper) |
protected static String |
toMixedCaseVariableName(String[] ss,
boolean startUpper,
boolean cdrUpper) |
static String |
toPackageName(String s) |
static String |
toPropertyName(String s) |
static String |
toVariableName(String s) |
static String[] |
toWordList(String s)
Tokenizes a string into words and capitalizes the first
character of each word.
|
protected static boolean isPunct(char c)
protected static boolean isDigit(char c)
protected static boolean isUpper(char c)
protected static boolean isLower(char c)
protected static boolean isLetter(char c)
public static String capitalize(String s)
protected static int nextBreak(String s, int start)
public static 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 static String toMixedCaseVariableName(String[] ss, boolean startUpper, boolean cdrUpper)
public static String toConstantName(String s)
public static String toConstantName(String[] ss)
public static void escape(StringBuffer 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 String escapeURI(String s)
s
- source string to be escapedpublic static String getParentUriPath(String uriPath)
uriPath
- the uriPath (as returned by java.net.URI#getPath()public static String normalizeUriPath(String uriPath)
uriPath
- path of a URI (as returned by java.net.URI#getPath()public static boolean equalsIgnoreCase(String s, String t)
s
- string 1t
- string 2public static boolean equal(String s, String t)
s
- string 1t
- string 2Copyright © 2019 Oracle Corporation. All rights reserved.