Class BytecodeClass<T extends IClassLoader>
java.lang.Object
com.ibm.wala.classLoader.BytecodeClass<T>
- Type Parameters:
T
- type of classloader which loads this format of class.
- All Implemented Interfaces:
IClass
,IClassHierarchyDweller
A class representing which originates in some form of bytecode.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Collection
<IClass> The IClasses that represent all interfaces this class implements (if it's a class) or extends (it it's an interface)protected final IClassHierarchy
Governing class hierarchy for this classprotected int
hash code; cached here for efficiencyA mapping from Selector to IMethod used to cache method lookups from superclassesprotected IField[]
The instance fields declared in this class.protected ImmutableByteArray[]
The names of interfaces for this class.protected final T
The object that loaded this class.A mapping from Selector to IMethodprotected IField[]
The static fields declared in this class.protected IClass
superclassprotected boolean
Compute the superclass lazily.protected ImmutableByteArray
An Atom which holds the name of the super class.protected TypeReference
Canonical type representation -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addFieldToList
(List<FieldImpl> L, Atom name, ImmutableByteArray fieldType, int accessFlags, Collection<Annotation> annotations, Collection<TypeAnnotation> typeAnnotations, TypeSignature sig) protected Collection
<IClass> protected abstract IMethod[]
protected void
set up the methodMap mappingfindDeclaredField
(Atom name) Compute the instance and static fields declared by this class or any of its superclasses.Compute the instance fields declared by this class or any of its superclasses.Compute the methods declared by this class or any of its superclasses.Compute the static fields declared by this class or any of its superclasses.abstract Collection
<Annotation> getAnnotations
(boolean runtimeVisible) Return the object that represents the defining class loader for this class.abstract Module
Compute the instance fields declared by this class.Collection
<? extends IClass> Finds a field.Finds a field, given a name and a type.Finds method matching signature.getName()
int
hashCode()
boolean
boolean
Does 'this' refer to a reference type? If not, then it refers to a primitive type.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.ibm.wala.classLoader.IClass
getAnnotations, getClassInitializer, getModifiers, isAbstract, isInterface, isPrivate, isPublic, isSynthetic
-
Field Details
-
superName
An Atom which holds the name of the super class. We cache this for efficiency reasons. -
interfaceNames
The names of interfaces for this class. We cache this for efficiency reasons. -
loader
The object that loaded this class. -
cha
Governing class hierarchy for this class -
methodMap
-
inheritCache
-
typeReference
Canonical type representation -
superClass
superclass -
superclassComputed
protected boolean superclassComputedCompute the superclass lazily. -
allInterfaces
The IClasses that represent all interfaces this class implements (if it's a class) or extends (it it's an interface) -
instanceFields
The instance fields declared in this class. -
staticFields
The static fields declared in this class. -
hashCode
protected int hashCodehash code; cached here for efficiency
-
-
Constructor Details
-
BytecodeClass
-
-
Method Details
-
getContainer
-
getClassLoader
Description copied from interface:IClass
Return the object that represents the defining class loader for this class.- Specified by:
getClassLoader
in interfaceIClass
- Returns:
- the object that represents the defining class loader for this class.
-
computeDeclaredMethods
- Throws:
InvalidClassFileException
-
getReference
- Specified by:
getReference
in interfaceIClass
- Returns:
- canonical TypeReference corresponding to this class
-
getSourceFileName
- Specified by:
getSourceFileName
in interfaceIClass
- Returns:
- String holding the name of the source file that defined this class, or null if none found
-
getSource
-
hashCode
-
toString
-
isArrayClass
public boolean isArrayClass()- Specified by:
isArrayClass
in interfaceIClass
- Returns:
- true iff the class is an array class.
-
getClassHierarchy
- Specified by:
getClassHierarchy
in interfaceIClassHierarchyDweller
-
getName
-
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 interfaceIClass
-
getField
-
getField
-
getSuperclass
- Specified by:
getSuperclass
in interfaceIClass
- Returns:
- the superclass, or null if java.lang.Object
-
getSuperName
-
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 interfaceIClass
-
getAllImplementedInterfaces
- Specified by:
getAllImplementedInterfaces
in interfaceIClass
- 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.
-
getDeclaredInstanceFields
Description copied from interface:IClass
Compute the instance fields declared by this class.- Specified by:
getDeclaredInstanceFields
in interfaceIClass
- Returns:
- Collection of IFields
-
getDeclaredStaticFields
- Specified by:
getDeclaredStaticFields
in interfaceIClass
- Returns:
- Collection of IField
-
getDirectInterfaces
- Specified by:
getDirectInterfaces
in interfaceIClass
- Returns:
- Collection of (IClass) interfaces this class directly implements. If this class is an interface, returns the interfaces it immediately extends.
-
getAllInstanceFields
Description copied from interface:IClass
Compute the instance fields declared by this class or any of its superclasses.- Specified by:
getAllInstanceFields
in interfaceIClass
-
getAllStaticFields
Description copied from interface:IClass
Compute the static fields declared by this class or any of its superclasses.- Specified by:
getAllStaticFields
in interfaceIClass
-
getAllMethods
Description copied from interface:IClass
Compute the methods declared by this class or any of its superclasses.- Specified by:
getAllMethods
in interfaceIClass
-
getDeclaredMethods
- Specified by:
getDeclaredMethods
in interfaceIClass
- Returns:
- an Iterator of the IMethods declared by this class.
-
getMethod
Description copied from interface:IClass
Finds method matching signature. Delegates to superclass if not found. -
computeAllInterfacesAsCollection
- Returns:
- Collection of IClasses, representing the interfaces this class implements.
-
findDeclaredField
-
addFieldToList
protected void addFieldToList(List<FieldImpl> L, Atom name, ImmutableByteArray fieldType, int accessFlags, Collection<Annotation> annotations, Collection<TypeAnnotation> typeAnnotations, TypeSignature sig) -
computeMethodMapIfNeeded
set up the methodMap mapping- Throws:
InvalidClassFileException
-
getAnnotations
public abstract Collection<Annotation> getAnnotations(boolean runtimeVisible) throws InvalidClassFileException - Throws:
InvalidClassFileException
-