com.sun.tdk.signaturetest.core
Class Erasurator
java.lang.Object
com.sun.tdk.signaturetest.core.Erasurator
public class Erasurator
- extends java.lang.Object
Class Erasurator performs "Type erasure" (see JLS Third Edition, p.
4.6) Type erasure is a mapping from types (possibly including parameterized
types and type variables) to types (that are never parameterized types or
type variables). We write |T| for the erasure of type T. The erasure mapping
is defined as follows.
The erasure of a parameterized type (p3.5)
G<T1, ... ,Tn> is |G|. The erasure of a nested type T.C is
|T|.C. The erasure of an array type T[] is |T|[]. The
erasure of a type variable (p3.4) is the erasure of its leftmost bound.
The erasure of every other type is the type itself. The erasure of a
method signature s is a signature consisting of the same name as s, and the
erasures of all the formal parameter types given in s.
When the Erasurator finds the definition of a generic type or
method, it removes all occurrences of the type parameters and replaces them
by their leftmost bound, or type Object if no bound had been specified.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Erasurator
public Erasurator()
erasure
public ClassDescription erasure(ClassDescription clz)
fullErasure
public ClassDescription fullErasure(ClassDescription clz)
parseTypeParameters
public void parseTypeParameters(ClassDescription classDescr)
processMember
public MemberDescription processMember(MemberDescription mr)
splitParameters
public static java.util.ArrayList splitParameters(java.lang.String actualTypeParams)
replaceFormalParameters
public static MemberDescription[] replaceFormalParameters(java.lang.String fqn,
MemberDescription[] members,
java.util.List actualTypeParamList,
boolean skipRawTypes)
replaceFormalParameters
public static java.util.Collection replaceFormalParameters(java.lang.String fqn,
java.util.Collection members,
java.util.List actualTypeParamList,
boolean skipRawTypes)