Interface NameConverter

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  NameConverter.Standard  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String toClassName​(java.lang.String token)
      converts a string into an identifier suitable for classes.
      java.lang.String toConstantName​(java.lang.String token)
      converts a string into an identifier suitable for constants.
      java.lang.String toInterfaceName​(java.lang.String token)
      converts a string into an identifier suitable for interfaces.
      java.lang.String toPackageName​(java.lang.String namespaceUri)
      Converts a namespace URI into a package name.
      java.lang.String toPropertyName​(java.lang.String token)
      converts a string into an identifier suitable for properties.
      java.lang.String toVariableName​(java.lang.String token)
      Converts a string into an identifier suitable for variables.
    • Field Detail

      • standard

        static final NameConverter standard
        The name converter implemented by Code Model. This is the standard name conversion for JAXB.
      • jaxrpcCompatible

        static final NameConverter jaxrpcCompatible
        JAX-PRC compatible name converter implementation. The only difference is that we treat '_' as a valid character and not as a word separator.
      • smart

        static final NameConverter smart
        Smarter converter used for RELAX NG support.
    • Method Detail

      • toClassName

        java.lang.String toClassName​(java.lang.String token)
        converts a string into an identifier suitable for classes. In general, this operation should generate "NamesLikeThis".
      • toInterfaceName

        java.lang.String toInterfaceName​(java.lang.String token)
        converts a string into an identifier suitable for interfaces. In general, this operation should generate "NamesLikeThis". But for example, it can prepend every interface with 'I'.
      • toPropertyName

        java.lang.String toPropertyName​(java.lang.String token)
        converts a string into an identifier suitable for properties. In general, this operation should generate "NamesLikeThis", which will be used with known prefixes like "get" or "set".
      • toConstantName

        java.lang.String toConstantName​(java.lang.String token)
        converts a string into an identifier suitable for constants. In the standard Java naming convention, this operation should generate "NAMES_LIKE_THIS".
      • toVariableName

        java.lang.String toVariableName​(java.lang.String token)
        Converts a string into an identifier suitable for variables. In general it should generate "namesLikeThis".
      • toPackageName

        java.lang.String toPackageName​(java.lang.String namespaceUri)
        Converts a namespace URI into a package name. This method should expect strings like "http://foo.bar.zot/org", "urn:abc:def:ghi" "", or even "###" (basically anything) and expected to return a package name, liks "org.acme.foo".