com.sun.xml.ws.spi.db
Class BindingHelper

java.lang.Object
  extended by com.sun.xml.ws.spi.db.BindingHelper

public class BindingHelper
extends Object

BindingHelper


Constructor Summary
BindingHelper()
           
 
Method Summary
static
<T> Class<T>
erasure(Type t)
           
static Type getBaseType(Type type, Class baseType)
          Gets the parameterization of the given base type.
static String mangleNameToClassName(String localName)
          Computes a Java class name from a local name.
static String mangleNameToPropertyName(String localName)
          Computes a Java class name from a local name.
static String mangleNameToVariableName(String localName)
          Computes a Java identifier from a local name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindingHelper

public BindingHelper()
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


 interface Foo<T> extends List<List<T>> {}
 interface Bar extends Foo<String> {}
 
This method works like this:

 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 from baseType
baseType - The class whose parameterization we are interested in.
Returns:
The use of baseType in type. or null if the type is not assignable to the base type.
Since:
2.0 FCS

erasure

public static <T> Class<T> erasure(Type t)


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.