Package com.sun.xml.ws.spi.db
Class BindingHelper
- java.lang.Object
-
- com.sun.xml.ws.spi.db.BindingHelper
-
public class BindingHelper extends Object
BindingHelper- Author:
- shih-chang.chen@oracle.com
-
-
Constructor Summary
Constructors Constructor Description BindingHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Class<T>erasure(Type 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.
-
-
-
Method Detail
-
mangleNameToVariableName
@NotNull public static String mangleNameToVariableName(@NotNull String localName)
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
@NotNull public static String mangleNameToClassName(@NotNull String localName)
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
@NotNull public static String mangleNameToPropertyName(@NotNull String localName)
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
@Nullable public static Type getBaseType(@NotNull Type type, @NotNull Class baseType)
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
-
-