Class NameUtil

java.lang.Object
org.apache.xmlbeans.impl.common.NameUtil

public class NameUtil extends Object
  • Field Details

  • Constructor Details

    • NameUtil

      public NameUtil()
  • Method Details

    • isValidJavaIdentifier

      public static boolean isValidJavaIdentifier(String id)
    • getClassNameFromQName

      public static String getClassNameFromQName(QName qname)
    • getClassNameFromQName

      public static String getClassNameFromQName(QName qname, boolean useJaxRpcRules)
    • getNamespaceFromPackage

      public static String getNamespaceFromPackage(Class<?> clazz)
    • getPackageFromNamespace

      public static String getPackageFromNamespace(String uri)
    • getPackageFromNamespace

      public static String getPackageFromNamespace(String uri, boolean useJaxRpcRules)
    • main

      public static void main(String[] args)
    • upperCaseUnderbar

      public static String upperCaseUnderbar(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 String upperCamelCase(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 String upperCamelCase(String xml_name, boolean useJaxRpcRules)
      Returns a camel-cased string, but either JAXB or JAX-RPC rules are used
    • lowerCamelCase

      public static String lowerCamelCase(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 String lowerCamelCase(String xml_name, boolean useJaxRpcRules, boolean fixGeneratedName)
      Returns a camel-cased string using the JAXB or JAX-RPC rules
    • upperCaseFirstLetter

      public static String upperCaseFirstLetter(String s)
    • splitWords

      public static List<String> splitWords(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 String nonJavaKeyword(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 String nonExtraKeyword(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 String nonJavaCommonClassName(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(String word)