edu.rice.cs.dynamicjava.symbol
Class JavaClass

java.lang.Object
  extended by edu.rice.cs.dynamicjava.symbol.JavaClass
All Implemented Interfaces:
Access.Limited, Access.Module, DJClass
Direct Known Subclasses:
Java5Class

public class JavaClass
extends Object
implements DJClass

DJClass implementation that wraps a Java reflection Class object. The Java5Class version should be used instead if the class object supports Java 5 methods like Class.getTypeParameters().


Nested Class Summary
protected  class JavaClass.JavaConstructor
          Non-static in order to determine the outer type.
protected  class JavaClass.JavaField
           
protected  class JavaClass.JavaMethod
           
 
Field Summary
protected  Class<?> _c
           
 
Constructor Summary
JavaClass(Class<?> c)
           
 
Method Summary
 Access accessibility()
          The symbol's access level.
 Access.Module accessModule()
          Get the module enclosing this symbol's declaration.
 Iterable<DJClass> declaredClasses()
           
 Iterable<DJConstructor> declaredConstructors()
           
 Iterable<DJField> declaredFields()
           
 Iterable<DJMethod> declaredMethods()
           
 String declaredName()
          Produce the (unqualified) declared name of the given class
 Iterable<Type> declaredSupertypes()
          List the declared supertypes of this class
 Iterable<VariableType> declaredTypeParameters()
          List all type variables declared by this class (but not by its enclosing classes)
 DJClass declaringClass()
          The class that declares this class, or null if this is declared at a top-level or local scope
 boolean equals(Object o)
          Equality must be defined so that distinct DJClasses that wrap the same class are equal.
 String fullName()
          Produces the binary name for the given class (as in Class.getName())
 int hashCode()
          Equality must be defined so that distinct DJClasses that wrap the same class are equal.
 boolean hasRuntimeBindingsParams()
           
 Type immediateSuperclass()
          Return the type bound to super in the context of this class, or null if super is not defined
 boolean isAbstract()
           
 boolean isAnonymous()
           
 boolean isFinal()
           
 boolean isInterface()
           
 boolean isStatic()
           
 Class<?> load()
          Produce the runtime representation of the class (as in ClassLoader.loadClass(java.lang.String), repeated invocations should produce the same object).
 String packageName()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_c

protected Class<?> _c
Constructor Detail

JavaClass

public JavaClass(Class<?> c)
Method Detail

packageName

public String packageName()
Specified by:
packageName in interface Access.Module
Specified by:
packageName in interface DJClass

fullName

public String fullName()
Produces the binary name for the given class (as in Class.getName())

Specified by:
fullName in interface DJClass

isAnonymous

public boolean isAnonymous()
Specified by:
isAnonymous in interface DJClass

declaredName

public String declaredName()
Description copied from interface: DJClass
Produce the (unqualified) declared name of the given class

Specified by:
declaredName in interface Access.Limited
Specified by:
declaredName in interface DJClass

isInterface

public boolean isInterface()
Specified by:
isInterface in interface DJClass

isStatic

public boolean isStatic()
Specified by:
isStatic in interface DJClass

isAbstract

public boolean isAbstract()
Specified by:
isAbstract in interface DJClass

isFinal

public boolean isFinal()
Specified by:
isFinal in interface DJClass

accessibility

public Access accessibility()
Description copied from interface: Access.Limited
The symbol's access level.

Specified by:
accessibility in interface Access.Limited
Specified by:
accessibility in interface DJClass

hasRuntimeBindingsParams

public boolean hasRuntimeBindingsParams()
Specified by:
hasRuntimeBindingsParams in interface DJClass

accessModule

public Access.Module accessModule()
Description copied from interface: Access.Limited
Get the module enclosing this symbol's declaration.

Specified by:
accessModule in interface Access.Limited

declaringClass

public DJClass declaringClass()
Description copied from interface: DJClass
The class that declares this class, or null if this is declared at a top-level or local scope

Specified by:
declaringClass in interface DJClass

declaredTypeParameters

public Iterable<VariableType> declaredTypeParameters()
List all type variables declared by this class (but not by its enclosing classes)

Specified by:
declaredTypeParameters in interface DJClass

declaredSupertypes

public Iterable<Type> declaredSupertypes()
List the declared supertypes of this class

Specified by:
declaredSupertypes in interface DJClass

declaredFields

public Iterable<DJField> declaredFields()
Specified by:
declaredFields in interface DJClass

declaredConstructors

public Iterable<DJConstructor> declaredConstructors()
Specified by:
declaredConstructors in interface DJClass

declaredMethods

public Iterable<DJMethod> declaredMethods()
Specified by:
declaredMethods in interface DJClass

declaredClasses

public Iterable<DJClass> declaredClasses()
Specified by:
declaredClasses in interface DJClass

immediateSuperclass

public Type immediateSuperclass()
Return the type bound to super in the context of this class, or null if super is not defined

Specified by:
immediateSuperclass in interface DJClass
Returns:
The type bound to super in the context of this class, or null if super is not defined

load

public Class<?> load()
Description copied from interface: DJClass
Produce the runtime representation of the class (as in ClassLoader.loadClass(java.lang.String), repeated invocations should produce the same object).

Specified by:
load in interface DJClass

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Description copied from interface: DJClass
Equality must be defined so that distinct DJClasses that wrap the same class are equal.

Specified by:
equals in interface DJClass
Overrides:
equals in class Object

hashCode

public int hashCode()
Description copied from interface: DJClass
Equality must be defined so that distinct DJClasses that wrap the same class are equal.

Specified by:
hashCode in interface DJClass
Overrides:
hashCode in class Object