com.sun.xml.bind.api.impl
Class NameConverter.Standard
java.lang.Object
com.sun.xml.bind.api.impl.NameUtil
com.sun.xml.bind.api.impl.NameConverter.Standard
- All Implemented Interfaces:
- NameConverter
- Enclosing interface:
- NameConverter
public static class NameConverter.Standard
- extends NameUtil
- implements NameConverter
Method Summary |
java.lang.String |
toClassName(java.lang.String s)
converts a string into an identifier suitable for classes. |
java.lang.String |
toConstantName(java.lang.String token)
Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF". |
java.lang.String |
toInterfaceName(java.lang.String token)
converts a string into an identifier suitable for interfaces. |
java.lang.String |
toPackageName(java.lang.String s)
Converts a string into a package name. |
java.lang.String |
toPropertyName(java.lang.String s)
converts a string into an identifier suitable for properties. |
java.lang.String |
toVariableName(java.lang.String s)
Converts a string into an identifier suitable for variables. |
Methods inherited from class com.sun.xml.bind.api.impl.NameUtil |
capitalize, classify, escape, isDigit, isJavaIdentifier, isJavaPackageName, isLetter, isLower, isPunct, isUpper, toConstantName, toMixedCaseName, toMixedCaseVariableName, toWordList |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NameConverter.Standard
public NameConverter.Standard()
toClassName
public java.lang.String toClassName(java.lang.String s)
- Description copied from interface:
NameConverter
- converts a string into an identifier suitable for classes.
In general, this operation should generate "NamesLikeThis".
- Specified by:
toClassName
in interface NameConverter
toVariableName
public java.lang.String toVariableName(java.lang.String s)
- Description copied from interface:
NameConverter
- Converts a string into an identifier suitable for variables.
In general it should generate "namesLikeThis".
- Specified by:
toVariableName
in interface NameConverter
toInterfaceName
public java.lang.String toInterfaceName(java.lang.String token)
- Description copied from interface:
NameConverter
- 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'.
- Specified by:
toInterfaceName
in interface NameConverter
toPropertyName
public java.lang.String toPropertyName(java.lang.String s)
- Description copied from interface:
NameConverter
- 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".
- Specified by:
toPropertyName
in interface NameConverter
toConstantName
public java.lang.String toConstantName(java.lang.String token)
- Description copied from class:
NameUtil
- Formats a string into "THIS_KIND_OF_FORMAT_ABC_DEF".
- Specified by:
toConstantName
in interface NameConverter
- Overrides:
toConstantName
in class NameUtil
- Returns:
- Always return a string but there's no guarantee that
the generated code is a valid Java identifier.
toPackageName
public java.lang.String toPackageName(java.lang.String s)
- Description copied from interface:
NameConverter
- Converts a string into a package name.
This method should expect input like "org", "ACME", or "Foo"
and return something like "org", "acme", or "foo" respectively
(assuming that it follows the standard Java convention.)
- Specified by:
toPackageName
in interface NameConverter