T
- type of classloader which loads this format of class.public abstract class BytecodeClass<T extends IClassLoader> extends Object implements IClass
Modifier and Type | Field and Description |
---|---|
protected 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 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 Map<Selector,IMethod> |
methodMap
A mapping from Selector to IMethod
TODO: get rid of this for classes (though keep it for interfaces) instead ...
|
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(List<FieldImpl> L,
Atom name,
ImmutableByteArray fieldType,
int accessFlags,
Collection<Annotation> annotations,
TypeSignature sig) |
protected Collection<IClass> |
computeAllInterfacesAsCollection() |
protected abstract IMethod[] |
computeDeclaredMethods() |
protected void |
computeMethodMapIfNeeded()
set up the methodMap mapping
|
protected List<IField> |
findDeclaredField(Atom name) |
Collection<IField> |
getAllFields()
Compute the instance and static fields declared by this class or any of its superclasses.
|
Collection<IClass> |
getAllImplementedInterfaces() |
Collection<IField> |
getAllInstanceFields()
Compute the instance fields declared by this class or any of its superclasses.
|
Collection<IMethod> |
getAllMethods()
Compute the methods declared by this class or any of its superclasses.
|
Collection<IField> |
getAllStaticFields()
Compute the static fields declared by this class or any of its superclasses.
|
abstract Collection<Annotation> |
getAnnotations(boolean runtimeVisible) |
IClassHierarchy |
getClassHierarchy() |
IClassLoader |
getClassLoader()
Return the object that represents the defining class loader for this class.
|
abstract Module |
getContainer() |
Collection<IField> |
getDeclaredInstanceFields()
Compute the instance fields declared by this class.
|
Collection<IMethod> |
getDeclaredMethods() |
Collection<IField> |
getDeclaredStaticFields() |
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() |
Reader |
getSource() |
String |
getSourceFileName() |
IClass |
getSuperclass() |
int |
hashCode() |
boolean |
isArrayClass() |
boolean |
isReferenceType()
Does 'this' refer to a reference type? If not, then it refers to a primitive type.
|
protected void |
populateFieldArrayFromList(List<FieldImpl> L,
IField[] A) |
String |
toString() |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
getAnnotations, getClassInitializer, getModifiers, isAbstract, isInterface, isPrivate, isPublic
protected ImmutableByteArray superName
protected ImmutableByteArray[] interfaceNames
protected final T extends IClassLoader loader
protected final IClassHierarchy cha
protected volatile Map<Selector,IMethod> methodMap
protected Map<Selector,IMethod> inheritCache
protected TypeReference typeReference
protected IClass superClass
protected boolean superclassComputed
protected 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()
IClass
getClassLoader
in interface IClass
protected abstract IMethod[] computeDeclaredMethods() throws InvalidClassFileException
InvalidClassFileException
public TypeReference getReference()
getReference
in interface IClass
public String getSourceFileName()
getSourceFileName
in interface IClass
public Reader getSource()
public boolean isArrayClass()
isArrayClass
in interface IClass
public IClassHierarchy getClassHierarchy()
getClassHierarchy
in interface IClassHierarchyDweller
public TypeName getName()
public boolean isReferenceType()
IClass
isReferenceType
in interface IClass
public IField getField(Atom name, TypeName type)
IClass
null
if not found.public IClass getSuperclass()
getSuperclass
in interface IClass
public Collection<IField> getAllFields()
IClass
getAllFields
in interface IClass
public Collection<IClass> getAllImplementedInterfaces()
getAllImplementedInterfaces
in interface IClass
public Collection<IField> getDeclaredInstanceFields()
IClass
getDeclaredInstanceFields
in interface IClass
public Collection<IField> getDeclaredStaticFields()
getDeclaredStaticFields
in interface IClass
public Collection<? extends IClass> getDirectInterfaces()
getDirectInterfaces
in interface IClass
public Collection<IField> getAllInstanceFields()
IClass
getAllInstanceFields
in interface IClass
public Collection<IField> getAllStaticFields()
IClass
getAllStaticFields
in interface IClass
public Collection<IMethod> getAllMethods()
IClass
getAllMethods
in interface IClass
public Collection<IMethod> getDeclaredMethods()
getDeclaredMethods
in interface IClass
public IMethod getMethod(Selector selector)
IClass
protected Collection<IClass> computeAllInterfacesAsCollection()
protected void addFieldToList(List<FieldImpl> L, Atom name, ImmutableByteArray fieldType, int accessFlags, Collection<Annotation> annotations, TypeSignature sig)
protected void computeMethodMapIfNeeded() throws InvalidClassFileException
InvalidClassFileException
public abstract Collection<Annotation> getAnnotations(boolean runtimeVisible) throws InvalidClassFileException
InvalidClassFileException