T - type of classloader which loads this format of class.public abstract class BytecodeClass<T extends IClassLoader> extends java.lang.Object implements IClass
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Collection<IClass> |
allInterfaces
The IClasses that represent all interfaces this class implements (if it's a class) or extends
(it it's an interface)
|
protected IClassHierarchy |
cha
Governing class hierarchy for this class
|
protected int |
hashCode
hash code; cached here for efficiency
|
protected java.util.Map<Selector,IMethod> |
inheritCache
A mapping from Selector to IMethod used to cache method lookups from superclasses
|
protected IField[] |
instanceFields
The instance fields declared in this class.
|
protected ImmutableByteArray[] |
interfaceNames
The names of interfaces for this class.
|
protected T |
loader
The object that loaded this class.
|
protected java.util.Map<Selector,IMethod> |
methodMap
A mapping from Selector to IMethod
|
protected IField[] |
staticFields
The static fields declared in this class.
|
protected IClass |
superClass
superclass
|
protected boolean |
superclassComputed
Compute the superclass lazily.
|
protected ImmutableByteArray |
superName
An Atom which holds the name of the super class.
|
protected TypeReference |
typeReference
Canonical type representation
|
| Modifier | Constructor and Description |
|---|---|
protected |
BytecodeClass(T loader,
IClassHierarchy cha) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFieldToList(java.util.List<FieldImpl> L,
Atom name,
ImmutableByteArray fieldType,
int accessFlags,
java.util.Collection<Annotation> annotations,
java.util.Collection<TypeAnnotation> typeAnnotations,
TypeSignature sig) |
protected java.util.Collection<IClass> |
computeAllInterfacesAsCollection() |
protected abstract IMethod[] |
computeDeclaredMethods() |
protected void |
computeMethodMapIfNeeded()
set up the methodMap mapping
|
protected java.util.List<IField> |
findDeclaredField(Atom name) |
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.
|
abstract java.util.Collection<Annotation> |
getAnnotations(boolean runtimeVisible) |
IClassHierarchy |
getClassHierarchy() |
IClassLoader |
getClassLoader()
Return the object that represents the defining class loader for this class.
|
abstract Module |
getContainer() |
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<? extends IClass> |
getDirectInterfaces() |
IField |
getField(Atom name)
Finds a field.
|
IField |
getField(Atom name,
TypeName type)
Finds a field, given a name and a type.
|
IMethod |
getMethod(Selector selector)
Finds method matching signature.
|
TypeName |
getName() |
TypeReference |
getReference() |
java.io.Reader |
getSource() |
java.lang.String |
getSourceFileName() |
IClass |
getSuperclass() |
TypeName |
getSuperName() |
int |
hashCode() |
boolean |
isArrayClass() |
boolean |
isReferenceType()
Does 'this' refer to a reference type? If not, then it refers to a primitive type.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitgetAnnotations, getClassInitializer, getModifiers, isAbstract, isInterface, isPrivate, isPublic, isSyntheticprotected ImmutableByteArray superName
protected ImmutableByteArray[] interfaceNames
protected final T extends IClassLoader loader
protected final IClassHierarchy cha
protected volatile java.util.Map<Selector,IMethod> methodMap
TODO: get rid of this for classes (though keep it for interfaces) instead ... use a VMT.
protected java.util.Map<Selector,IMethod> inheritCache
protected TypeReference typeReference
protected IClass superClass
protected boolean superclassComputed
protected java.util.Collection<IClass> allInterfaces
protected IField[] instanceFields
protected IField[] staticFields
protected int hashCode
protected BytecodeClass(T loader, IClassHierarchy cha)
public abstract Module getContainer()
public IClassLoader getClassLoader()
IClassgetClassLoader in interface IClassprotected abstract IMethod[] computeDeclaredMethods() throws com.ibm.wala.shrikeCT.InvalidClassFileException
com.ibm.wala.shrikeCT.InvalidClassFileExceptionpublic TypeReference getReference()
getReference in interface IClasspublic java.lang.String getSourceFileName()
getSourceFileName in interface IClasspublic java.io.Reader getSource()
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isArrayClass()
isArrayClass in interface IClasspublic IClassHierarchy getClassHierarchy()
getClassHierarchy in interface IClassHierarchyDwellerpublic TypeName getName()
public boolean isReferenceType()
IClassisReferenceType in interface IClasspublic IField getField(Atom name, TypeName type)
IClassnull if not found.public IClass getSuperclass()
getSuperclass in interface IClasspublic TypeName getSuperName()
public java.util.Collection<IField> getAllFields()
IClassgetAllFields in interface IClasspublic java.util.Collection<IClass> getAllImplementedInterfaces()
getAllImplementedInterfaces in interface IClasspublic java.util.Collection<IField> getDeclaredInstanceFields()
IClassgetDeclaredInstanceFields in interface IClasspublic java.util.Collection<IField> getDeclaredStaticFields()
getDeclaredStaticFields in interface IClasspublic java.util.Collection<? extends IClass> getDirectInterfaces()
getDirectInterfaces in interface IClasspublic java.util.Collection<IField> getAllInstanceFields()
IClassgetAllInstanceFields in interface IClasspublic java.util.Collection<IField> getAllStaticFields()
IClassgetAllStaticFields in interface IClasspublic java.util.Collection<IMethod> getAllMethods()
IClassgetAllMethods in interface IClasspublic java.util.Collection<IMethod> getDeclaredMethods()
getDeclaredMethods in interface IClasspublic IMethod getMethod(Selector selector)
IClassprotected java.util.Collection<IClass> computeAllInterfacesAsCollection()
protected void addFieldToList(java.util.List<FieldImpl> L, Atom name, ImmutableByteArray fieldType, int accessFlags, java.util.Collection<Annotation> annotations, java.util.Collection<TypeAnnotation> typeAnnotations, TypeSignature sig)
protected void computeMethodMapIfNeeded()
throws com.ibm.wala.shrikeCT.InvalidClassFileException
com.ibm.wala.shrikeCT.InvalidClassFileExceptionpublic abstract java.util.Collection<Annotation> getAnnotations(boolean runtimeVisible) throws com.ibm.wala.shrikeCT.InvalidClassFileException
com.ibm.wala.shrikeCT.InvalidClassFileException