Package org.apache.xmlbeans.impl.common
Class NameUtil
java.lang.Object
org.apache.xmlbeans.impl.common.NameUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetCharClass(char c, boolean useJaxRpcRules) static StringgetClassNameFromQName(QName qname) static StringgetClassNameFromQName(QName qname, boolean useJaxRpcRules) static StringgetNamespaceFromPackage(Class<?> clazz) static Stringstatic StringgetPackageFromNamespace(String uri, boolean useJaxRpcRules) static booleanisJavaCommonClassName(String word) static booleanisPunctuation(char c, boolean useJaxRpcRules) static booleanstatic StringlowerCamelCase(String xml_name) Returns a camel-cased string using the JAXB rules, where the first component is lowercased.static StringlowerCamelCase(String xml_name, boolean useJaxRpcRules, boolean fixGeneratedName) Returns a camel-cased string using the JAXB or JAX-RPC rulesstatic voidstatic StringnonExtraKeyword(String word) Intended to be applied to a lowercase-starting identifier that may collide with a Java keyword.static StringnonJavaCommonClassName(String name) Intended to be applied to an uppercase-starting identifier that may collide with a java.lang.* classname.static StringnonJavaKeyword(String word) Intended to be applied to a lowercase-starting identifier that may collide with a Java keyword.splitWords(String name, boolean useJaxRpcRules) static StringupperCamelCase(String xml_name) Returns a camel-cased string using the JAXB rules.static StringupperCamelCase(String xml_name, boolean useJaxRpcRules) Returns a camel-cased string, but either JAXB or JAX-RPC rules are usedstatic Stringstatic StringupperCaseUnderbar(String xml_name) Returns a upper-case-and-underbar string using the JAXB rules.
-
Field Details
-
HYPHEN
public static final char HYPHEN- See Also:
-
PERIOD
public static final char PERIOD- See Also:
-
COLON
public static final char COLON- See Also:
-
USCORE
public static final char USCORE- See Also:
-
DOT
public static final char DOT- See Also:
-
TELEIA
public static final char TELEIA- See Also:
-
AYAH
public static final char AYAH- See Also:
-
ELHIZB
public static final char ELHIZB- See Also:
-
-
Constructor Details
-
NameUtil
public NameUtil()
-
-
Method Details
-
isValidJavaIdentifier
-
getClassNameFromQName
-
getClassNameFromQName
-
getNamespaceFromPackage
-
getPackageFromNamespace
-
getPackageFromNamespace
-
main
-
upperCaseUnderbar
Returns a upper-case-and-underbar string using the JAXB rules. Always starts with a capital letter that is a valid java identifier start. (If JAXB rules don't produce one, then "X_" is prepended.) -
upperCamelCase
Returns a camel-cased string using the JAXB rules. Always starts with a capital letter that is a valid java identifier start. (If JAXB rules don't produce one, then "X" is prepended.) -
upperCamelCase
Returns a camel-cased string, but either JAXB or JAX-RPC rules are used -
lowerCamelCase
Returns a camel-cased string using the JAXB rules, where the first component is lowercased. Note that if the first component is an acronym, the whole thigns gets lowercased. Always starts with a lowercase letter that is a valid java identifier start. (If JAXB rules don't produce one, then "x" is prepended.) -
lowerCamelCase
public static String lowerCamelCase(String xml_name, boolean useJaxRpcRules, boolean fixGeneratedName) Returns a camel-cased string using the JAXB or JAX-RPC rules -
upperCaseFirstLetter
-
splitWords
-
getCharClass
public static int getCharClass(char c, boolean useJaxRpcRules) -
isPunctuation
public static boolean isPunctuation(char c, boolean useJaxRpcRules) -
nonJavaKeyword
Intended to be applied to a lowercase-starting identifier that may collide with a Java keyword. If it does collide, this prepends the letter "x". -
nonExtraKeyword
Intended to be applied to a lowercase-starting identifier that may collide with a Java keyword. If it does collide, this prepends the letter "x". -
nonJavaCommonClassName
Intended to be applied to an uppercase-starting identifier that may collide with a java.lang.* classname. If it does collide, this prepends the letter "X". -
isJavaCommonClassName
-