com.ibm.wala.classLoader
Interface IClass

All Superinterfaces:
IClassHierarchyDweller
All Known Implementing Classes:
ArrayClass, AstClass, AstDynamicPropertyClass, AstFunctionClass, BypassSyntheticClass, FakeRootClass, JavaSourceLoaderImpl.JavaClass, ShrikeClass, SyntheticClass

public interface IClass
extends IClassHierarchyDweller

Basic interface for an object that represents a single Java class for analysis purposes, including array classes.


Method Summary
 java.util.Collection<IClass> getAllAncestorInterfaces()
           
 java.util.Collection<IField> getAllFields()
          Compute the instance and static fields declared by this class or any of its superclasses.
 java.util.Collection<IClass> getAllImplementedInterfaces()
           
 java.util.Collection<IField> getAllInstanceFields()
          Compute the instance fields declared by this class or any of its superclasses.
 java.util.Collection<IMethod> getAllMethods()
          Compute the methods declared by this class or any of its superclasses.
 java.util.Collection<IField> getAllStaticFields()
          Compute the static fields declared by this class or any of its superclasses.
 IMethod getClassInitializer()
           
 IClassLoader getClassLoader()
          Return the object that represents the defining class loader for this class.
 java.util.Collection<IField> getDeclaredInstanceFields()
          Compute the instance fields declared by this class.
 java.util.Collection<IMethod> getDeclaredMethods()
           
 java.util.Collection<IField> getDeclaredStaticFields()
           
 java.util.Collection<IClass> getDirectInterfaces()
           
 IField getField(Atom name)
          Finds a field.
 IMethod getMethod(Selector selector)
          Finds method matching signature.
 int getModifiers()
          Return the integer that encodes the class's modifiers, as defined by the JVM specification
 TypeName getName()
           
 TypeReference getReference()
           
 java.lang.String getSourceFileName()
           
 IClass getSuperclass()
           
 boolean isAbstract()
           
 boolean isArrayClass()
           
 boolean isInterface()
          Is this class a Java interface?
 boolean isPublic()
           
 boolean isReferenceType()
          Does 'this' refer to a reference type? If not, then it refers to a primitive type.
 
Methods inherited from interface com.ibm.wala.ipa.cha.IClassHierarchyDweller
getClassHierarchy
 

Method Detail

getClassLoader

IClassLoader getClassLoader()
Return the object that represents the defining class loader for this class.

Returns:
the object that represents the defining class loader for this class.

isInterface

boolean isInterface()
Is this class a Java interface?

Returns:
boolean

isAbstract

boolean isAbstract()
Returns:
true iff this class is abstract

isPublic

boolean isPublic()
Returns:
true iff this class is public

getModifiers

int getModifiers()
Return the integer that encodes the class's modifiers, as defined by the JVM specification

Returns:
the integer that encodes the class's modifiers, as defined by the JVM specification

getSuperclass

IClass getSuperclass()
                     throws ClassHierarchyException
Returns:
the superclass, or null if java.lang.Object
Throws:
ClassHierarchyException

getDirectInterfaces

java.util.Collection<IClass> getDirectInterfaces()
                                                 throws ClassHierarchyException
Returns:
Collection of (IClass) interfaces this class directly implements
Throws:
ClassHierarchyException

getAllImplementedInterfaces

java.util.Collection<IClass> getAllImplementedInterfaces()
                                                         throws ClassHierarchyException
Returns:
Collection of (IClass) interfaces this class implements, including all ancestors of interfaces immediately implemented
Throws:
ClassHierarchyException

getAllAncestorInterfaces

java.util.Collection<IClass> getAllAncestorInterfaces()
                                                      throws ClassHierarchyException
Returns:
Collection of (IClass) interfaces this class extends, including transitive ancestors
Throws:
ClassHierarchyException

getMethod

IMethod getMethod(Selector selector)
Finds method matching signature. Delegates to superclass if not found.

Parameters:
selector - a method signature
Returns:
IMethod from this class matching the signature; null if not found in this class or any superclass.

getField

IField getField(Atom name)
Finds a field.


getReference

TypeReference getReference()
Returns:
canonical TypeReference corresponding to this class

getSourceFileName

java.lang.String getSourceFileName()
Returns:
String holding the name of the source file that defined this class, or null if none found

getClassInitializer

IMethod getClassInitializer()
Returns:
the method that is this class's initializer, or null if none

isArrayClass

boolean isArrayClass()
Returns:
true iff the class is an array class.

getDeclaredMethods

java.util.Collection<IMethod> getDeclaredMethods()
Returns:
an Iterator of the IMethods declared by this class.

getAllInstanceFields

java.util.Collection<IField> getAllInstanceFields()
                                                  throws ClassHierarchyException
Compute the instance fields declared by this class or any of its superclasses.

Returns:
Collection of IFields
Throws:
ClassHierarchyException

getAllStaticFields

java.util.Collection<IField> getAllStaticFields()
                                                throws ClassHierarchyException
Compute the static fields declared by this class or any of its superclasses.

Returns:
Collection of IFields
Throws:
ClassHierarchyException

getAllFields

java.util.Collection<IField> getAllFields()
                                          throws ClassHierarchyException
Compute the instance and static fields declared by this class or any of its superclasses.

Returns:
Collection of IFields
Throws:
ClassHierarchyException

getAllMethods

java.util.Collection<IMethod> getAllMethods()
                                            throws ClassHierarchyException
Compute the methods declared by this class or any of its superclasses.

Returns:
Collection of IMethods
Throws:
ClassHierarchyException

getDeclaredInstanceFields

java.util.Collection<IField> getDeclaredInstanceFields()
Compute the instance fields declared by this class.

Returns:
Collection of IFields

getDeclaredStaticFields

java.util.Collection<IField> getDeclaredStaticFields()
Returns:
Collection of IField

getName

TypeName getName()
Returns:
the TypeName for this class

isReferenceType

boolean isReferenceType()
Does 'this' refer to a reference type? If not, then it refers to a primitive type.