com.google.gwt.core.ext.typeinfo
Class JParameterizedType

java.lang.Object
  extended by com.google.gwt.core.ext.typeinfo.JType
      extended by com.google.gwt.core.ext.typeinfo.JClassType
          extended by com.google.gwt.core.ext.typeinfo.JParameterizedType
All Implemented Interfaces:
HasAnnotations, HasMetaData

public class JParameterizedType
extends JClassType

Represents a parameterized type in a declaration.


Constructor Summary
JParameterizedType(JGenericType baseType, JClassType enclosingType, JClassType[] typeArgs)
           
 
Method Summary
protected  void acceptSubtype(JClassType me)
           
 void addImplementedInterface(JClassType intf)
           
 void addMetaData(java.lang.String tagName, java.lang.String[] values)
          Adds additional metadata.
 void addModifierBits(int bits)
           
 JConstructor findConstructor(JType[] paramTypes)
          Delegating types generally cannot be constructed.
 JField findField(java.lang.String name)
          Subclasses will generally need to echo modified fields.
 JMethod findMethod(java.lang.String name, JType[] paramTypes)
          Subclasses will generally need to echo modified methods.
 JClassType findNestedType(java.lang.String typeName)
           
protected  JClassType findNestedTypeImpl(java.lang.String[] typeName, int index)
           
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationClass)
          Returns an instance of the specified annotation type if it is present on this element or null if it is not.
 JGenericType getBaseType()
           
 JConstructor getConstructor(JType[] paramTypes)
          Delegating types generally cannot be constructed.
 JConstructor[] getConstructors()
          Delegating types generally cannot be constructed.
 JClassType getEnclosingType()
           
 JClassType getErasedType()
           
 JField getField(java.lang.String name)
          Subclasses will generally need to echo modified fields.
 JField[] getFields()
          Subclasses will generally need to echo modified fields.
 JClassType[] getImplementedInterfaces()
           
 java.lang.String getJNISignature()
           
 java.lang.String[][] getMetaData(java.lang.String tagName)
          Gets each list of metadata for the specified tag name.
 java.lang.String[] getMetaDataTags()
          Gets the name of available metadata tags.
 JMethod getMethod(java.lang.String name, JType[] paramTypes)
          Subclasses will generally need to echo modified methods.
 JMethod[] getMethods()
          Subclasses will generally need to echo modified methods.
protected  int getModifierBits()
           
 java.lang.String getName()
           
 JClassType getNestedType(java.lang.String typeName)
           
 JClassType[] getNestedTypes()
           
 java.lang.String getNonParameterizedQualifiedSourceName()
          Deprecated. See getQualifiedSourceName()
 TypeOracle getOracle()
           
 JMethod[] getOverloads(java.lang.String name)
           
 JMethod[] getOverridableMethods()
          Iterates over the most-derived declaration of each unique overridable method available in the type hierarchy of the specified type, including those found in superclasses and superinterfaces.
protected  void getOverridableMethodsOnSuperclassesAndThisClass(java.util.Map<java.lang.String,JMethod> methodsBySignature)
           
protected  void getOverridableMethodsOnSuperinterfacesAndMaybeThisInterface(java.util.Map<java.lang.String,JMethod> methodsBySignature)
          Gets the methods declared in interfaces that this type extends.
 JPackage getPackage()
           
 java.lang.String getParameterizedQualifiedSourceName()
           
 java.lang.String getQualifiedSourceName()
          Everything is fully qualified and includes the < and > in the signature.
 JClassType getRawType()
           
 java.lang.String getSimpleSourceName()
          In this case, the raw type name.
 JClassType[] getSubtypes()
           
 JClassType getSuperclass()
           
 JClassType[] getTypeArgs()
           
 int hashCode()
           
 boolean isAbstract()
           
 boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
          Returns true if this item has an annotation of the specified type.
 JArrayType isArray()
           
 JClassType isClass()
           
 JClassType isClassOrInterface()
           
 boolean isDefaultInstantiable()
          Determines if the class can be constructed using a simple new operation.
 JEnumType isEnum()
          Returns this instance if it is an enumeration or null if it is not.
 boolean isFinal()
           
 JGenericType isGenericType()
           
 JClassType isInterface()
           
 boolean isLocalType()
          Tests if this type is a local type (within a method).
protected  com.google.gwt.core.ext.typeinfo.JMaybeParameterizedType isMaybeParameterizedType()
           
 boolean isMemberType()
          Tests if this type is contained within another type.
 JParameterizedType isParameterized()
           
 JPrimitiveType isPrimitive()
           
 boolean isPrivate()
           
 boolean isProtected()
           
 boolean isPublic()
           
 JRawType isRawType()
           
 boolean isStatic()
           
 JWildcardType isWildcard()
           
protected  void notifySuperTypesOf(JClassType me)
          Tells this type's superclasses and superinterfaces about it.
protected  void removeSubtype(JClassType me)
           
 void setSuperclass(JClassType type)
           
 void setTypeArguments(JClassType[] typeArgs)
           
 java.lang.String toString()
           
 
Methods inherited from class com.google.gwt.core.ext.typeinfo.JClassType
asParameterizationOf, getFlattenedSuperTypeHierarchy, isAssignableFrom, isAssignableTo, makeCompoundName
 
Methods inherited from class com.google.gwt.core.ext.typeinfo.JType
getLeafType, isAnnotation, isTypeParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JParameterizedType

public JParameterizedType(JGenericType baseType,
                          JClassType enclosingType,
                          JClassType[] typeArgs)
Method Detail

findConstructor

public JConstructor findConstructor(JType[] paramTypes)
Delegating types generally cannot be constructed.


findField

public JField findField(java.lang.String name)
Subclasses will generally need to echo modified fields.


findMethod

public JMethod findMethod(java.lang.String name,
                          JType[] paramTypes)
Subclasses will generally need to echo modified methods.


findNestedType

public JClassType findNestedType(java.lang.String typeName)

getConstructor

public JConstructor getConstructor(JType[] paramTypes)
                            throws NotFoundException
Delegating types generally cannot be constructed.

Throws:
NotFoundException

getConstructors

public JConstructor[] getConstructors()
Delegating types generally cannot be constructed.


getEnclosingType

public JClassType getEnclosingType()

getField

public JField getField(java.lang.String name)
Subclasses will generally need to echo modified fields.


getFields

public JField[] getFields()
Subclasses will generally need to echo modified fields.


getImplementedInterfaces

public JClassType[] getImplementedInterfaces()

getMethod

public JMethod getMethod(java.lang.String name,
                         JType[] paramTypes)
                  throws NotFoundException
Subclasses will generally need to echo modified methods.

Throws:
NotFoundException

getMethods

public JMethod[] getMethods()
Subclasses will generally need to echo modified methods.


getNestedType

public JClassType getNestedType(java.lang.String typeName)
                         throws NotFoundException
Throws:
NotFoundException

getNestedTypes

public JClassType[] getNestedTypes()

getNonParameterizedQualifiedSourceName

@Deprecated
public java.lang.String getNonParameterizedQualifiedSourceName()
Deprecated. See getQualifiedSourceName()


getOverloads

public JMethod[] getOverloads(java.lang.String name)

getOverridableMethods

public JMethod[] getOverridableMethods()
Description copied from class: JClassType
Iterates over the most-derived declaration of each unique overridable method available in the type hierarchy of the specified type, including those found in superclasses and superinterfaces. A method is overridable if it is not final and its accessibility is public, protected, or package protected. Deferred binding generators often need to generate method implementations; this method offers a convenient way to find candidate methods to implement. Note that the behavior does not match Class.getMethod(String, Class[]), which does not return the most derived method in some cases.

Returns:
an array of JMethod objects representing overridable methods

getParameterizedQualifiedSourceName

public java.lang.String getParameterizedQualifiedSourceName()
Overrides:
getParameterizedQualifiedSourceName in class JType

getQualifiedSourceName

public java.lang.String getQualifiedSourceName()
Everything is fully qualified and includes the < and > in the signature.

Specified by:
getQualifiedSourceName in class JType

getRawType

public JClassType getRawType()

getSimpleSourceName

public java.lang.String getSimpleSourceName()
In this case, the raw type name.

Specified by:
getSimpleSourceName in class JType

getSubtypes

public JClassType[] getSubtypes()

getSuperclass

public JClassType getSuperclass()

getTypeArgs

public JClassType[] getTypeArgs()

isGenericType

public JGenericType isGenericType()
Specified by:
isGenericType in class JClassType

isParameterized

public JParameterizedType isParameterized()
Specified by:
isParameterized in class JType

isRawType

public JRawType isRawType()
Specified by:
isRawType in class JType

isWildcard

public JWildcardType isWildcard()
Specified by:
isWildcard in class JType

setTypeArguments

public void setTypeArguments(JClassType[] typeArgs)

toString

public java.lang.String toString()

findNestedTypeImpl

protected JClassType findNestedTypeImpl(java.lang.String[] typeName,
                                        int index)

getOverridableMethodsOnSuperclassesAndThisClass

protected void getOverridableMethodsOnSuperclassesAndThisClass(java.util.Map<java.lang.String,JMethod> methodsBySignature)

getOverridableMethodsOnSuperinterfacesAndMaybeThisInterface

protected void getOverridableMethodsOnSuperinterfacesAndMaybeThisInterface(java.util.Map<java.lang.String,JMethod> methodsBySignature)
Gets the methods declared in interfaces that this type extends. If this type is a class, its own methods are not added. If this type is an interface, its own methods are added. Used internally by getOverridableMethods().

Parameters:
methodsBySignature -

getBaseType

public JGenericType getBaseType()

isMaybeParameterizedType

protected com.google.gwt.core.ext.typeinfo.JMaybeParameterizedType isMaybeParameterizedType()
Overrides:
isMaybeParameterizedType in class JClassType

addImplementedInterface

public final void addImplementedInterface(JClassType intf)
Specified by:
addImplementedInterface in class JClassType

addMetaData

public final void addMetaData(java.lang.String tagName,
                              java.lang.String[] values)
Description copied from interface: HasMetaData
Adds additional metadata.

Specified by:
addMetaData in interface HasMetaData
Specified by:
addMetaData in class JClassType

addModifierBits

public final void addModifierBits(int bits)
Specified by:
addModifierBits in class JClassType

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
Description copied from interface: HasAnnotations
Returns an instance of the specified annotation type if it is present on this element or null if it is not.

Specified by:
getAnnotation in interface HasAnnotations
Specified by:
getAnnotation in class JClassType
Parameters:
annotationClass - annotation type to search for
Returns:
instance of the specified annotation type if it is present on this element or null if it is not

getErasedType

public JClassType getErasedType()
Specified by:
getErasedType in class JClassType

getJNISignature

public java.lang.String getJNISignature()
Specified by:
getJNISignature in class JType

getMetaData

public java.lang.String[][] getMetaData(java.lang.String tagName)
Description copied from interface: HasMetaData
Gets each list of metadata for the specified tag name.

Specified by:
getMetaData in interface HasMetaData
Specified by:
getMetaData in class JClassType

getMetaDataTags

public java.lang.String[] getMetaDataTags()
Description copied from interface: HasMetaData
Gets the name of available metadata tags.

Specified by:
getMetaDataTags in interface HasMetaData
Specified by:
getMetaDataTags in class JClassType

getName

public java.lang.String getName()
Specified by:
getName in class JClassType

getOracle

public TypeOracle getOracle()
Specified by:
getOracle in class JClassType

getPackage

public JPackage getPackage()
Specified by:
getPackage in class JClassType

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isAbstract

public boolean isAbstract()
Specified by:
isAbstract in class JClassType

isAnnotationPresent

public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Description copied from interface: HasAnnotations
Returns true if this item has an annotation of the specified type.

Specified by:
isAnnotationPresent in interface HasAnnotations
Specified by:
isAnnotationPresent in class JClassType
Returns:
true if this item has an annotation of the specified type

isArray

public final JArrayType isArray()
Specified by:
isArray in class JType

isClass

public JClassType isClass()
Specified by:
isClass in class JType

isClassOrInterface

public JClassType isClassOrInterface()
Overrides:
isClassOrInterface in class JType

isDefaultInstantiable

public boolean isDefaultInstantiable()
Description copied from class: JClassType
Determines if the class can be constructed using a simple new operation. Specifically, the class must

Specified by:
isDefaultInstantiable in class JClassType
Returns:
true if the type is default instantiable, or false otherwise

isEnum

public final JEnumType isEnum()
Description copied from class: JType
Returns this instance if it is an enumeration or null if it is not.

Specified by:
isEnum in class JType
Returns:
this instance if it is an enumeration or null if it is not

isFinal

public boolean isFinal()
Specified by:
isFinal in class JClassType

isInterface

public JClassType isInterface()
Specified by:
isInterface in class JClassType

isLocalType

public boolean isLocalType()
Description copied from class: JClassType
Tests if this type is a local type (within a method).

Specified by:
isLocalType in class JClassType
Returns:
true if this type is a local type, whether it is named or anonymous.

isMemberType

public boolean isMemberType()
Description copied from class: JClassType
Tests if this type is contained within another type.

Specified by:
isMemberType in class JClassType
Returns:
true if this type has an enclosing type, false if this type is a top-level type

isPrimitive

public final JPrimitiveType isPrimitive()
Specified by:
isPrimitive in class JType

isPrivate

public boolean isPrivate()
Specified by:
isPrivate in class JClassType

isProtected

public boolean isProtected()
Specified by:
isProtected in class JClassType

isPublic

public boolean isPublic()
Specified by:
isPublic in class JClassType

isStatic

public boolean isStatic()
Specified by:
isStatic in class JClassType

setSuperclass

public void setSuperclass(JClassType type)
Specified by:
setSuperclass in class JClassType

acceptSubtype

protected void acceptSubtype(JClassType me)
Specified by:
acceptSubtype in class JClassType

getModifierBits

protected int getModifierBits()
Specified by:
getModifierBits in class JClassType

notifySuperTypesOf

protected void notifySuperTypesOf(JClassType me)
Description copied from class: JClassType
Tells this type's superclasses and superinterfaces about it.

Specified by:
notifySuperTypesOf in class JClassType

removeSubtype

protected void removeSubtype(JClassType me)
Specified by:
removeSubtype in class JClassType