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
FieldsModifier 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 IClassHierarchyGoverning class hierarchy for this classprotected inthash 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 TThe object that loaded this class.A mapping from Selector to IMethodprotected IField[]The static fields declared in this class.protected IClasssuperclassprotected booleanCompute the superclass lazily.protected ImmutableByteArrayAn Atom which holds the name of the super class.protected TypeReferenceCanonical type representation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFieldToList(List<FieldImpl> L, Atom name, ImmutableByteArray fieldType, int accessFlags, Collection<Annotation> annotations, Collection<TypeAnnotation> typeAnnotations, TypeSignature sig) protected Collection<IClass> protected abstract IMethod[]protected voidset 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 ModuleCompute 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()inthashCode()booleanbooleanDoes 'this' refer to a reference type? If not, then it refers to a primitive type.toString()Methods inherited from class Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface 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:IClassReturn the object that represents the defining class loader for this class.- Specified by:
getClassLoaderin interfaceIClass- Returns:
- the object that represents the defining class loader for this class.
-
computeDeclaredMethods
- Throws:
InvalidClassFileException
-
getReference
- Specified by:
getReferencein interfaceIClass- Returns:
- canonical TypeReference corresponding to this class
-
getSourceFileName
- Specified by:
getSourceFileNamein 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:
isArrayClassin interfaceIClass- Returns:
- true iff the class is an array class.
-
getClassHierarchy
- Specified by:
getClassHierarchyin interfaceIClassHierarchyDweller
-
getName
-
isReferenceType
public boolean isReferenceType()Description copied from interface:IClassDoes 'this' refer to a reference type? If not, then it refers to a primitive type.- Specified by:
isReferenceTypein interfaceIClass
-
getField
-
getField
-
getSuperclass
- Specified by:
getSuperclassin interfaceIClass- Returns:
- the superclass, or null if java.lang.Object
-
getSuperName
-
getAllFields
Description copied from interface:IClassCompute the instance and static fields declared by this class or any of its superclasses.- Specified by:
getAllFieldsin interfaceIClass
-
getAllImplementedInterfaces
- Specified by:
getAllImplementedInterfacesin 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:IClassCompute the instance fields declared by this class.- Specified by:
getDeclaredInstanceFieldsin interfaceIClass- Returns:
- Collection of IFields
-
getDeclaredStaticFields
- Specified by:
getDeclaredStaticFieldsin interfaceIClass- Returns:
- Collection of IField
-
getDirectInterfaces
- Specified by:
getDirectInterfacesin 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:IClassCompute the instance fields declared by this class or any of its superclasses.- Specified by:
getAllInstanceFieldsin interfaceIClass
-
getAllStaticFields
Description copied from interface:IClassCompute the static fields declared by this class or any of its superclasses.- Specified by:
getAllStaticFieldsin interfaceIClass
-
getAllMethods
Description copied from interface:IClassCompute the methods declared by this class or any of its superclasses.- Specified by:
getAllMethodsin interfaceIClass
-
getDeclaredMethods
- Specified by:
getDeclaredMethodsin interfaceIClass- Returns:
- an Iterator of the IMethods declared by this class.
-
getMethod
Description copied from interface:IClassFinds 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
-