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

java.lang.Object
  extended bycom.google.gwt.core.ext.typeinfo.JType
      extended bycom.google.gwt.core.ext.typeinfo.JClassType
All Implemented Interfaces:
HasMetaData

public class JClassType
extends JType
implements HasMetaData

Type representing a Java class or interface type.


Constructor Summary
JClassType(TypeOracle oracle, CompilationUnitProvider cup, JPackage declaringPackage, JClassType enclosingType, boolean isLocalType, java.lang.String name, int declStart, int declEnd, int bodyStart, int bodyEnd, boolean isInterface)
           
 
Method Summary
 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)
           
 JField findField(java.lang.String name)
           
 JMethod findMethod(java.lang.String name, JType[] paramTypes)
           
 JClassType findNestedType(java.lang.String typeName)
           
 int getBodyEnd()
           
 int getBodyStart()
           
 CompilationUnitProvider getCompilationUnit()
           
 JConstructor getConstructor(JType[] paramTypes)
           
 JConstructor[] getConstructors()
           
 JClassType getEnclosingType()
           
 JField getField(java.lang.String name)
           
 JField[] getFields()
           
 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)
           
 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 getQualifiedSourceName()
           
 java.lang.String getSimpleSourceName()
           
 JClassType[] getSubtypes()
           
 JClassType getSuperclass()
           
 java.lang.String getTypeHash()
           
 boolean isAbstract()
           
 JArrayType isArray()
           
 boolean isAssignableFrom(JClassType possibleSubtype)
           
 boolean isAssignableTo(JClassType possibleSupertype)
           
 JClassType isClass()
           
 boolean isDefaultInstantiable()
          Determines if the class can be constructed using a simple new operation.
 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()
           
 boolean isStatic()
           
 void setSuperclass(JClassType type)
           
 java.lang.String toString()
           
 
Methods inherited from class com.google.gwt.core.ext.typeinfo.JType
getLeafType, getParameterizedQualifiedSourceName, isClassOrInterface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JClassType

public JClassType(TypeOracle oracle,
                  CompilationUnitProvider cup,
                  JPackage declaringPackage,
                  JClassType enclosingType,
                  boolean isLocalType,
                  java.lang.String name,
                  int declStart,
                  int declEnd,
                  int bodyStart,
                  int bodyEnd,
                  boolean isInterface)
Method Detail

addImplementedInterface

public void addImplementedInterface(JClassType intf)

addMetaData

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

Specified by:
addMetaData in interface HasMetaData

addModifierBits

public void addModifierBits(int bits)

findConstructor

public JConstructor findConstructor(JType[] paramTypes)

findField

public JField findField(java.lang.String name)

findMethod

public JMethod findMethod(java.lang.String name,
                          JType[] paramTypes)

findNestedType

public JClassType findNestedType(java.lang.String typeName)

getBodyEnd

public int getBodyEnd()

getBodyStart

public int getBodyStart()

getCompilationUnit

public CompilationUnitProvider getCompilationUnit()

getConstructor

public JConstructor getConstructor(JType[] paramTypes)
                            throws NotFoundException
Throws:
NotFoundException

getConstructors

public JConstructor[] getConstructors()

getEnclosingType

public JClassType getEnclosingType()

getField

public JField getField(java.lang.String name)

getFields

public JField[] getFields()

getImplementedInterfaces

public JClassType[] getImplementedInterfaces()

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

getMetaDataTags

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

Specified by:
getMetaDataTags in interface HasMetaData

getMethod

public JMethod getMethod(java.lang.String name,
                         JType[] paramTypes)
                  throws NotFoundException
Throws:
NotFoundException

getMethods

public JMethod[] getMethods()

getName

public java.lang.String getName()

getNestedType

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

getNestedTypes

public JClassType[] getNestedTypes()

getOracle

public TypeOracle getOracle()

getOverloads

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

getOverridableMethods

public 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. 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

getPackage

public JPackage getPackage()

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

getTypeHash

public java.lang.String getTypeHash()
                             throws UnableToCompleteException
Throws:
UnableToCompleteException

isAbstract

public boolean isAbstract()

isArray

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

isAssignableFrom

public boolean isAssignableFrom(JClassType possibleSubtype)

isAssignableTo

public boolean isAssignableTo(JClassType possibleSupertype)

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

Returns:
true if the type is default instantiable, or false otherwise

isInterface

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

isLocalType

public boolean isLocalType()
Tests if this type is a local type (within a method).

Returns:
true if this type is a local type, whether it is named or anonymous.

isMemberType

public boolean isMemberType()
Tests if this type is contained within another type.

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

isProtected

public boolean isProtected()

isPublic

public boolean isPublic()

isStatic

public boolean isStatic()

setSuperclass

public void setSuperclass(JClassType type)

toString

public java.lang.String toString()

getModifierBits

protected int getModifierBits()