com.ibm.wala.cast.loader
Class AstFunctionClass

java.lang.Object
  extended by com.ibm.wala.cast.loader.AstFunctionClass
All Implemented Interfaces:
IClass, IClassHierarchyDweller, ClassConstants

public abstract class AstFunctionClass
extends java.lang.Object
implements IClass, ClassConstants


Field Summary
protected  IMethod functionBody
           
 
Fields inherited from interface com.ibm.wala.shrikeCT.ClassConstants
ACC_ABSTRACT, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_TRANSIENT, ACC_VOLATILE, CONSTANT_Class, CONSTANT_Double, CONSTANT_FieldRef, CONSTANT_Float, CONSTANT_Integer, CONSTANT_InterfaceMethodRef, CONSTANT_Long, CONSTANT_MethodRef, CONSTANT_NameAndType, CONSTANT_String, CONSTANT_Utf8, MAGIC
 
Constructor Summary
protected AstFunctionClass(TypeReference reference, IClassLoader loader, CAstSourcePositionMap.Position sourcePosition)
           
protected AstFunctionClass(TypeReference reference, TypeReference superReference, IClassLoader loader, CAstSourcePositionMap.Position sourcePosition)
           
 
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.io.InputStream getSource()
           
 java.lang.String getSourceFileName()
           
 CAstSourcePositionMap.Position getSourcePosition()
           
 java.net.URL getSourceURL()
           
 IClass getSuperclass()
           
 boolean isAbstract()
           
 boolean isArrayClass()
           
 boolean isInterface()
          Is this class a Java interface?
 boolean isPrivate()
           
 boolean isPublic()
           
 boolean isReferenceType()
          Does 'this' refer to a reference type? If not, then it refers to a primitive type.
 boolean isStatic()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.wala.ipa.cha.IClassHierarchyDweller
getClassHierarchy
 

Field Detail

functionBody

protected IMethod functionBody
Constructor Detail

AstFunctionClass

protected AstFunctionClass(TypeReference reference,
                           TypeReference superReference,
                           IClassLoader loader,
                           CAstSourcePositionMap.Position sourcePosition)

AstFunctionClass

protected AstFunctionClass(TypeReference reference,
                           IClassLoader loader,
                           CAstSourcePositionMap.Position sourcePosition)
Method Detail

toString

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

getClassLoader

public IClassLoader getClassLoader()
Description copied from interface: IClass
Return the object that represents the defining class loader for this class.

Specified by:
getClassLoader in interface IClass
Returns:
the object that represents the defining class loader for this class.

isInterface

public boolean isInterface()
Description copied from interface: IClass
Is this class a Java interface?

Specified by:
isInterface in interface IClass

isAbstract

public boolean isAbstract()
Specified by:
isAbstract in interface IClass
Returns:
true iff this class is abstract

isPublic

public boolean isPublic()
Specified by:
isPublic in interface IClass
Returns:
true iff this class is public

isPrivate

public boolean isPrivate()
Specified by:
isPrivate in interface IClass
Returns:
true iff this class is private

isStatic

public boolean isStatic()

getModifiers

public int getModifiers()
Description copied from interface: IClass
Return the integer that encodes the class's modifiers, as defined by the JVM specification

Specified by:
getModifiers in interface IClass
Returns:
the integer that encodes the class's modifiers, as defined by the JVM specification

getSuperclass

public IClass getSuperclass()
Specified by:
getSuperclass in interface IClass
Returns:
the superclass, or null if java.lang.Object

getDirectInterfaces

public java.util.Collection<IClass> getDirectInterfaces()
Specified by:
getDirectInterfaces in interface IClass
Returns:
Collection of (IClass) interfaces this class directly implements. If this class is an interface, returns the interfaces it immediately extends.

getAllImplementedInterfaces

public java.util.Collection<IClass> getAllImplementedInterfaces()
Specified by:
getAllImplementedInterfaces in interface IClass
Returns:
Collection of (IClass) interfaces this class implements, including all ancestors of interfaces immediately implemented. If this class is an interface, it returns all super-interfaces.

getAllAncestorInterfaces

public java.util.Collection<IClass> getAllAncestorInterfaces()

getMethod

public IMethod getMethod(Selector selector)
Description copied from interface: IClass
Finds method matching signature. Delegates to superclass if not found.

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

getField

public IField getField(Atom name)
Description copied from interface: IClass
Finds a field.

Specified by:
getField in interface IClass

getReference

public TypeReference getReference()
Specified by:
getReference in interface IClass
Returns:
canonical TypeReference corresponding to this class

getSourcePosition

public CAstSourcePositionMap.Position getSourcePosition()

getSourceURL

public java.net.URL getSourceURL()

getSourceFileName

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

getSource

public java.io.InputStream getSource()
Specified by:
getSource in interface IClass
Returns:
String representing the source file holding this class, or null if not found

getClassInitializer

public IMethod getClassInitializer()
Specified by:
getClassInitializer in interface IClass
Returns:
the method that is this class's initializer, or null if none

isArrayClass

public boolean isArrayClass()
Specified by:
isArrayClass in interface IClass
Returns:
true iff the class is an array class.

getDeclaredMethods

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

getDeclaredInstanceFields

public java.util.Collection<IField> getDeclaredInstanceFields()
Description copied from interface: IClass
Compute the instance fields declared by this class.

Specified by:
getDeclaredInstanceFields in interface IClass
Returns:
Collection of IFields

getDeclaredStaticFields

public java.util.Collection<IField> getDeclaredStaticFields()
Specified by:
getDeclaredStaticFields in interface IClass
Returns:
Collection of IField

getAllInstanceFields

public java.util.Collection<IField> getAllInstanceFields()
Description copied from interface: IClass
Compute the instance fields declared by this class or any of its superclasses.

Specified by:
getAllInstanceFields in interface IClass

getAllStaticFields

public java.util.Collection<IField> getAllStaticFields()
Description copied from interface: IClass
Compute the static fields declared by this class or any of its superclasses.

Specified by:
getAllStaticFields in interface IClass

getAllFields

public java.util.Collection<IField> getAllFields()
Description copied from interface: IClass
Compute the instance and static fields declared by this class or any of its superclasses.

Specified by:
getAllFields in interface IClass

getAllMethods

public java.util.Collection<IMethod> getAllMethods()
Description copied from interface: IClass
Compute the methods declared by this class or any of its superclasses.

Specified by:
getAllMethods in interface IClass

getName

public TypeName getName()
Specified by:
getName in interface IClass
Returns:
the TypeName for this class

isReferenceType

public boolean isReferenceType()
Description copied from interface: IClass
Does 'this' refer to a reference type? If not, then it refers to a primitive type.

Specified by:
isReferenceType in interface IClass