Package com.sun.xml.ws.spi.db
Class BindingHelper
java.lang.Object
com.sun.xml.ws.spi.db.BindingHelper
BindingHelper
- Author:
- shih-chang.chen@oracle.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Class<T>static TypegetBaseType(Type type, Class baseType) Gets the parameterization of the given base type.static StringmangleNameToClassName(String localName) Computes a Java class name from a local name.static StringmangleNameToPropertyName(String localName) Computes a Java class name from a local name.static StringmangleNameToVariableName(String localName) Computes a Java identifier from a local name.
-
Constructor Details
-
BindingHelper
public BindingHelper()
-
-
Method Details
-
mangleNameToVariableName
Computes a Java identifier from a local name.This method faithfully implements the name mangling rule as specified in the JAXB spec.
In JAXB, a collision with a Java reserved word (such as "return") never happens. Accordingly, this method may return an identifier that collides with reserved words.
Use
JJavaName.isJavaIdentifier(String)to check for such collision.- Returns:
- Typically, this method returns "nameLikeThis".
-
mangleNameToClassName
Computes a Java class name from a local name.This method faithfully implements the name mangling rule as specified in the JAXB spec.
- Returns:
- Typically, this method returns "NameLikeThis".
-
mangleNameToPropertyName
Computes a Java class name from a local name.This method faithfully implements the name mangling rule as specified in the JAXB spec. This method works like
mangleNameToClassName(String)except that it looks for "getClass" and returns something else.- Returns:
- Typically, this method returns "NameLikeThis".
-
getBaseType
Gets the parameterization of the given base type.For example, given the following
This method works like this:interface Foo<T> extends List<List<T>> {} interface Bar extends Foo<String> {}getBaseClass( Bar, List ) = List<List<String> getBaseClass( Bar, Foo ) = Foo<String> getBaseClass( Foo<? extends Number>, Collection ) = Collection<List<? extends Number>> getBaseClass( ArrayList<? extends BigInteger>, List ) = List<? extends BigInteger>- Parameters:
type- The type that derives frombaseTypebaseType- The class whose parameterization we are interested in.- Returns:
- The use of
baseTypeintype. or null if the type is not assignable to the base type. - Since:
- 2.0 FCS
-
erasure
-