Package org.apache.xmlbeans.impl.common
Class NameUtil
- java.lang.Object
-
- org.apache.xmlbeans.impl.common.NameUtil
-
public class NameUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description NameUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getCharClass(char c, boolean useJaxRpcRules)
static java.lang.String
getClassNameFromQName(javax.xml.namespace.QName qname)
static java.lang.String
getClassNameFromQName(javax.xml.namespace.QName qname, boolean useJaxRpcRules)
static java.lang.String
getNamespaceFromPackage(java.lang.Class clazz)
static java.lang.String
getPackageFromNamespace(java.lang.String uri)
static java.lang.String
getPackageFromNamespace(java.lang.String uri, boolean useJaxRpcRules)
static boolean
isJavaCommonClassName(java.lang.String word)
static boolean
isPunctuation(char c, boolean useJaxRpcRules)
static boolean
isValidJavaIdentifier(java.lang.String id)
static java.lang.String
lowerCamelCase(java.lang.String xml_name)
Returns a camel-cased string using the JAXB rules, where the first component is lowercased.static java.lang.String
lowerCamelCase(java.lang.String xml_name, boolean useJaxRpcRules, boolean fixGeneratedName)
Returns a camel-cased string using the JAXB or JAX-RPC rulesstatic void
main(java.lang.String[] args)
static java.lang.String
nonExtraKeyword(java.lang.String word)
Intended to be applied to a lowercase-starting identifier that may collide with a Java keyword.static java.lang.String
nonJavaCommonClassName(java.lang.String name)
Intended to be applied to an uppercase-starting identifier that may collide with a java.lang.* classname.static java.lang.String
nonJavaKeyword(java.lang.String word)
Intended to be applied to a lowercase-starting identifier that may collide with a Java keyword.static java.util.List
splitWords(java.lang.String name, boolean useJaxRpcRules)
static java.lang.String
upperCamelCase(java.lang.String xml_name)
Returns a camel-cased string using the JAXB rules.static java.lang.String
upperCamelCase(java.lang.String xml_name, boolean useJaxRpcRules)
Returns a camel-cased string, but either JAXB or JAX-RPC rules are usedstatic java.lang.String
upperCaseFirstLetter(java.lang.String s)
static java.lang.String
upperCaseUnderbar(java.lang.String xml_name)
Returns a upper-case-and-underbar string using the JAXB rules.
-
-
-
Field Detail
-
HYPHEN
public static final char HYPHEN
- See Also:
- Constant Field Values
-
PERIOD
public static final char PERIOD
- See Also:
- Constant Field Values
-
COLON
public static final char COLON
- See Also:
- Constant Field Values
-
USCORE
public static final char USCORE
- See Also:
- Constant Field Values
-
DOT
public static final char DOT
- See Also:
- Constant Field Values
-
TELEIA
public static final char TELEIA
- See Also:
- Constant Field Values
-
AYAH
public static final char AYAH
- See Also:
- Constant Field Values
-
ELHIZB
public static final char ELHIZB
- See Also:
- Constant Field Values
-
-
Method Detail
-
isValidJavaIdentifier
public static boolean isValidJavaIdentifier(java.lang.String id)
-
getClassNameFromQName
public static java.lang.String getClassNameFromQName(javax.xml.namespace.QName qname)
-
getClassNameFromQName
public static java.lang.String getClassNameFromQName(javax.xml.namespace.QName qname, boolean useJaxRpcRules)
-
getNamespaceFromPackage
public static java.lang.String getNamespaceFromPackage(java.lang.Class clazz)
-
getPackageFromNamespace
public static java.lang.String getPackageFromNamespace(java.lang.String uri)
-
getPackageFromNamespace
public static java.lang.String getPackageFromNamespace(java.lang.String uri, boolean useJaxRpcRules)
-
main
public static void main(java.lang.String[] args)
-
upperCaseUnderbar
public static java.lang.String upperCaseUnderbar(java.lang.String xml_name)
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
public static java.lang.String upperCamelCase(java.lang.String xml_name)
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
public static java.lang.String upperCamelCase(java.lang.String xml_name, boolean useJaxRpcRules)
Returns a camel-cased string, but either JAXB or JAX-RPC rules are used
-
lowerCamelCase
public static java.lang.String lowerCamelCase(java.lang.String xml_name)
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 java.lang.String lowerCamelCase(java.lang.String xml_name, boolean useJaxRpcRules, boolean fixGeneratedName)
Returns a camel-cased string using the JAXB or JAX-RPC rules
-
upperCaseFirstLetter
public static java.lang.String upperCaseFirstLetter(java.lang.String s)
-
splitWords
public static java.util.List splitWords(java.lang.String name, boolean useJaxRpcRules)
-
getCharClass
public static int getCharClass(char c, boolean useJaxRpcRules)
-
isPunctuation
public static boolean isPunctuation(char c, boolean useJaxRpcRules)
-
nonJavaKeyword
public static java.lang.String nonJavaKeyword(java.lang.String word)
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
public static java.lang.String nonExtraKeyword(java.lang.String word)
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
public static java.lang.String nonJavaCommonClassName(java.lang.String name)
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
public static boolean isJavaCommonClassName(java.lang.String word)
-
-