com.sun.xml.bind.api.impl

Interface NameConverter

public interface NameConverter

Converts aribitrary strings into Java identifiers.
Nested Class Summary
static classNameConverter.Standard
Field Summary
static NameConverterjaxrpcCompatible
JAX-PRC compatible name converter implementation.
static NameConvertersmart
Smarter converter used for RELAX NG support.
static NameConverterstandard
The name converter implemented by Code Model.
Method Summary
StringtoClassName(String token)
converts a string into an identifier suitable for classes.
StringtoConstantName(String token)
converts a string into an identifier suitable for constants.
StringtoInterfaceName(String token)
converts a string into an identifier suitable for interfaces.
StringtoPackageName(String namespaceUri)
Converts a namespace URI into a package name.
StringtoPropertyName(String token)
converts a string into an identifier suitable for properties.
StringtoVariableName(String token)
Converts a string into an identifier suitable for variables.

Field Detail

jaxrpcCompatible

public 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

public static final NameConverter smart
Smarter converter used for RELAX NG support.

standard

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

Method Detail

toClassName

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

toConstantName

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

toInterfaceName

public String toInterfaceName(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'.

toPackageName

public String toPackageName(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".

toPropertyName

public String toPropertyName(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".

toVariableName

public String toVariableName(String token)
Converts a string into an identifier suitable for variables. In general it should generate "namesLikeThis".