GWT 2.1.1

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

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.JRealClassType
All Implemented Interfaces:
HasAnnotations, HasMetaData
Direct Known Subclasses:
JAnnotationType, JEnumType, JGenericType

public class JRealClassType
extends JClassType

Type representing a Java class or interface type that a user would declare.


Method Summary
protected  void acceptSubtype(JClassType me)
           
protected  void addConstructor(JConstructor ctor)
           
protected  void addField(JField field)
           
protected  void addMethod(JMethod method)
           
 void addModifierBits(int bits)
           
protected  void addNestedType(JClassType type)
           
 JConstructor findConstructor(JType[] paramTypes)
           
 JField findField(java.lang.String name)
           
 JMethod findMethod(java.lang.String name, JType[] paramTypes)
           
 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.
 JConstructor getConstructor(JType[] paramTypes)
           
 JConstructor[] getConstructors()
           
 JClassType getEnclosingType()
           
 JClassType getErasedType()
           
 JField getField(java.lang.String name)
           
 JField[] getFields()
           
 JClassType[] getImplementedInterfaces()
           
 JMethod[] getInheritableMethods()
          Iterates over the most-derived declaration of each unique inheritable method available in the type hierarchy of the specified type, including those found in superclasses and superinterfaces.
protected  void getInheritableMethodsOnSuperclassesAndThisClass(java.util.Map<java.lang.String,JMethod> methodsBySignature)
           
protected  void getInheritableMethodsOnSuperinterfacesAndMaybeThisInterface(java.util.Map<java.lang.String,JMethod> methodsBySignature)
          Gets the methods declared in interfaces that this type extends.
 java.lang.String getJNISignature()
           
 JMethod getMethod(java.lang.String name, JType[] paramTypes)
           
 JMethod[] getMethods()
           
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.
 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()
           
 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()
           
 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 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)
           
 java.lang.String toString()
           
 
Methods inherited from class com.google.gwt.core.ext.typeinfo.JClassType
asParameterizationOf, findAnnotationInTypeHierarchy, getFlattenedSupertypeHierarchy, getFlattenedSuperTypeHierarchy, getMetaData, getMetaDataTags, isAssignableFrom, isAssignableTo, isEnhanced, isLocalType, isMaybeParameterizedType, setEnhanced
 
Methods inherited from class com.google.gwt.core.ext.typeinfo.JType
equals, getLeafType, getParameterizedQualifiedSourceName, hashCode, isAnnotation, isClassOrInterface, isTypeParameter
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

addModifierBits

public void addModifierBits(int bits)

findConstructor

public JConstructor findConstructor(JType[] paramTypes)
Specified by:
findConstructor in class JClassType

findField

public JField findField(java.lang.String name)
Specified by:
findField in class JClassType

findMethod

public JMethod findMethod(java.lang.String name,
                          JType[] paramTypes)
Specified by:
findMethod 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

getConstructor

public JConstructor getConstructor(JType[] paramTypes)
                            throws NotFoundException
Specified by:
getConstructor in class JClassType
Throws:
NotFoundException

getConstructors

public JConstructor[] getConstructors()
Specified by:
getConstructors in class JClassType

getEnclosingType

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

getErasedType

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

getField

public JField getField(java.lang.String name)
Specified by:
getField in class JClassType

getFields

public JField[] getFields()
Specified by:
getFields in class JClassType

getImplementedInterfaces

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

getInheritableMethods

public JMethod[] getInheritableMethods()
Description copied from class: JClassType
Iterates over the most-derived declaration of each unique inheritable method available in the type hierarchy of the specified type, including those found in superclasses and superinterfaces. A method is inheritable if its accessibility is public, protected, or package protected. This method offers a convenient way for Generators to find candidate methods to call from a subclass.

Specified by:
getInheritableMethods in class JClassType
Returns:
an array of JMethod objects representing inheritable methods

getJNISignature

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

getMethod

public JMethod getMethod(java.lang.String name,
                         JType[] paramTypes)
                  throws NotFoundException
Specified by:
getMethod in class JClassType
Throws:
NotFoundException

getMethods

public JMethod[] getMethods()
Specified by:
getMethods in class JClassType

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

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()
Specified by:
getSubtypes in class JClassType

getSuperclass

public JClassType getSuperclass()
Specified by:
getSuperclass 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 JArrayType isArray()
Specified by:
isArray in class JType

isClass

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

isDefaultInstantiable

public boolean isDefaultInstantiable()
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 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

isGenericType

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

isInterface

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

isMemberType

public boolean isMemberType()
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

isParameterized

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

isPrimitive

public 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

isRawType

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

isStatic

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

isWildcard

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

toString

public java.lang.String toString()
Overrides:
toString in class JClassType

acceptSubtype

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

addConstructor

protected void addConstructor(JConstructor ctor)

addField

protected void addField(JField field)

addMethod

protected void addMethod(JMethod method)

addNestedType

protected void addNestedType(JClassType type)

findNestedTypeImpl

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

getInheritableMethodsOnSuperclassesAndThisClass

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

getInheritableMethodsOnSuperinterfacesAndMaybeThisInterface

protected void getInheritableMethodsOnSuperinterfacesAndMaybeThisInterface(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().

Specified by:
getInheritableMethodsOnSuperinterfacesAndMaybeThisInterface in class JClassType
Parameters:
methodsBySignature -

getModifierBits

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

notifySuperTypesOf

protected void notifySuperTypesOf(JClassType me)
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

GWT 2.1.1