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

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.JWildcardType
All Implemented Interfaces:
HasAnnotations, HasMetaData

public class JWildcardType
extends JClassType

Represents a wildcard type argument to a parameterized type.


Nested Class Summary
static class JWildcardType.BoundType
          Type of wildcard bound.
 
Constructor Summary
JWildcardType(JWildcardType.BoundType boundType, JClassType typeBound)
           
 
Method Summary
protected  void acceptSubtype(JClassType me)
           
 void addImplementedInterface(JClassType intf)
           
 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)
           
<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.
 JClassType getBaseType()
           
 JWildcardType.BoundType getBoundType()
           
 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 getFirstBound()
           
 JClassType[] getImplementedInterfaces()
           
 java.lang.String getJNISignature()
           
 JClassType[] getLowerBounds()
          Returns the lower bounds of this wildcard type.
 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()
           
 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 getQualifiedBinaryName()
          TODO(scottb): remove if we can resolve param names differently.
 java.lang.String getQualifiedSourceName()
           
 java.lang.String getSimpleSourceName()
           
 JClassType[] getSubtypes()
           
 JClassType getSuperclass()
           
 JClassType getUpperBound()
           
 JClassType[] getUpperBounds()
          Returns the upper bounds of this wildcard type.
 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).
 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)
           
 java.lang.String toString()
           
 
Methods inherited from class com.google.gwt.core.ext.typeinfo.JClassType
addMetaData, asParameterizationOf, findAnnotationInTypeHierarchy, getFlattenedSuperTypeHierarchy, getMetaData, getMetaDataTags, isAssignableFrom, isAssignableTo, isEnhanced, isMaybeParameterizedType, setEnhanced
 
Methods inherited from class com.google.gwt.core.ext.typeinfo.JType
equals, getLeafType, getParameterizedQualifiedSourceName, hashCode, isAnnotation, isTypeParameter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JWildcardType

public JWildcardType(JWildcardType.BoundType boundType,
                     JClassType typeBound)
Method Detail

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.


getBoundType

public JWildcardType.BoundType getBoundType()

getErasedType

public JClassType getErasedType()

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.


getFirstBound

public JClassType getFirstBound()

getLowerBounds

public JClassType[] getLowerBounds()
Returns the lower bounds of this wildcard type. If no lower bounds were declared, an empty array is returned.

Returns:
the lower bounds of this wildcard type

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.


getQualifiedBinaryName

public java.lang.String getQualifiedBinaryName()
Description copied from class: JType
TODO(scottb): remove if we can resolve param names differently.

Specified by:
getQualifiedBinaryName in class JType

getQualifiedSourceName

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

getSimpleSourceName

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

getSubtypes

public JClassType[] getSubtypes()

getSuperclass

public JClassType getSuperclass()

getUpperBound

public JClassType getUpperBound()

getUpperBounds

public JClassType[] getUpperBounds()
Returns the upper bounds of this wildcard type. If no upper bounds were declared, an array containing Object is returned.

Returns:
the upper bounds of this wildcard type

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

addImplementedInterface

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

addModifierBits

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

findConstructor

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

Specified by:
findConstructor in class JClassType

findNestedType

public JClassType findNestedType(java.lang.String typeName)
Specified by:
findNestedType 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

getBaseType

public JClassType getBaseType()

getConstructor

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

Specified by:
getConstructor in class JClassType
Throws:
NotFoundException

getConstructors

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

Specified by:
getConstructors in class JClassType

getEnclosingType

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

getImplementedInterfaces

public JClassType[] getImplementedInterfaces()
Specified by:
getImplementedInterfaces in class JClassType

getJNISignature

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

getName

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

getNestedType

public JClassType getNestedType(java.lang.String typeName)
                         throws NotFoundException
Specified by:
getNestedType in class JClassType
Throws:
NotFoundException

getNestedTypes

public JClassType[] getNestedTypes()
Specified by:
getNestedTypes in class JClassType

getOracle

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

getOverloads

public JMethod[] getOverloads(java.lang.String name)
Specified by:
getOverloads in class JClassType

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.

Specified by:
getOverridableMethods in class JClassType
Returns:
an array of JMethod objects representing overridable methods

getPackage

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

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

toString

public java.lang.String toString()
Overrides:
toString 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

getOverridableMethodsOnSuperclassesAndThisClass

protected void getOverridableMethodsOnSuperclassesAndThisClass(java.util.Map<java.lang.String,JMethod> methodsBySignature)
Specified by:
getOverridableMethodsOnSuperclassesAndThisClass in class JClassType

getOverridableMethodsOnSuperinterfacesAndMaybeThisInterface

protected void getOverridableMethodsOnSuperinterfacesAndMaybeThisInterface(java.util.Map<java.lang.String,JMethod> methodsBySignature)
Description copied from class: JClassType
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 JClassType.getOverridableMethods().

Specified by:
getOverridableMethodsOnSuperinterfacesAndMaybeThisInterface 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