|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.shrikeCT.ClassReader
public final class ClassReader
This is the core class for reading class file data. ClassReader performs lazy parsing, and thus most of the methods can throw an InvalidClassFileException.
| Nested Class Summary | |
|---|---|
static class |
ClassReader.AttrIterator
AttrIterator provides access to attributes in the class file. |
| Field Summary |
|---|
| 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 | |
|---|---|
ClassReader(byte[] bytes)
Build a reader. |
|
| Method Summary | |
|---|---|
int |
getAccessFlags()
|
byte |
getByte(int i)
|
byte[] |
getBytes()
|
ConstantPoolParser |
getCP()
This method allows direct read-only access to the constant pool for the class. |
int |
getFieldAccessFlags(int f)
|
int |
getFieldCount()
|
java.lang.String |
getFieldName(int f)
|
int |
getFieldNameIndex(int f)
|
int |
getFieldRawOffset(int f)
|
int |
getFieldRawSize(int f)
|
java.lang.String |
getFieldType(int f)
|
int |
getFieldTypeIndex(int f)
|
int |
getInt(int i)
|
int |
getInterfaceCount()
|
java.lang.String |
getInterfaceName(int i)
|
int |
getInterfaceNameIndex(int i)
|
int[] |
getInterfaceNameIndices()
|
java.lang.String[] |
getInterfaceNames()
|
int |
getMagic()
|
int |
getMajorVersion()
|
int |
getMethodAccessFlags(int m)
|
int |
getMethodCount()
|
java.lang.String |
getMethodName(int m)
|
int |
getMethodNameIndex(int m)
|
int |
getMethodRawOffset(int m)
|
int |
getMethodRawSize(int m)
|
java.lang.String |
getMethodType(int m)
|
int |
getMethodTypeIndex(int m)
|
int |
getMinorVersion()
|
java.lang.String |
getName()
|
int |
getNameIndex()
|
int |
getShort(int i)
|
java.lang.String |
getSuperName()
|
int |
getSuperNameIndex()
|
int |
getUShort(int i)
|
void |
initClassAttributeIterator(ClassReader.AttrIterator iter)
Point iter at the list of attributes for the class. |
void |
initFieldAttributeIterator(int f,
ClassReader.AttrIterator iter)
Point iter at the list of attributes for field f. |
void |
initMethodAttributeIterator(int m,
ClassReader.AttrIterator iter)
Point iter at the list of attributes for method m. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassReader(byte[] bytes)
throws InvalidClassFileException
bytes - the class file data
InvalidClassFileException - the class file data is corrupt| Method Detail |
|---|
public byte[] getBytes()
public int getMagic()
public int getMinorVersion()
public int getMajorVersion()
public int getAccessFlags()
public int getNameIndex()
public java.lang.String getName()
throws InvalidClassFileException
InvalidClassFileExceptionpublic int getSuperNameIndex()
public java.lang.String getSuperName()
throws InvalidClassFileException
InvalidClassFileExceptionpublic int getInterfaceCount()
public int getInterfaceNameIndex(int i)
public int[] getInterfaceNameIndices()
public java.lang.String getInterfaceName(int i)
throws InvalidClassFileException
InvalidClassFileException
public java.lang.String[] getInterfaceNames()
throws InvalidClassFileException
InvalidClassFileExceptionpublic ConstantPoolParser getCP()
public int getInt(int i)
public int getUShort(int i)
public int getShort(int i)
public byte getByte(int i)
public int getFieldCount()
public int getFieldAccessFlags(int f)
public java.lang.String getFieldName(int f)
throws InvalidClassFileException
InvalidClassFileException
public java.lang.String getFieldType(int f)
throws InvalidClassFileException
InvalidClassFileExceptionpublic int getFieldNameIndex(int f)
public int getFieldTypeIndex(int f)
public void initFieldAttributeIterator(int f,
ClassReader.AttrIterator iter)
java.lang.IllegalArgumentException - if iter is nullpublic int getFieldRawOffset(int f)
public int getFieldRawSize(int f)
public int getMethodCount()
public int getMethodRawOffset(int m)
public int getMethodRawSize(int m)
public int getMethodAccessFlags(int m)
public java.lang.String getMethodName(int m)
throws InvalidClassFileException
InvalidClassFileException
public java.lang.String getMethodType(int m)
throws InvalidClassFileException
InvalidClassFileExceptionpublic int getMethodNameIndex(int m)
public int getMethodTypeIndex(int m)
public void initMethodAttributeIterator(int m,
ClassReader.AttrIterator iter)
java.lang.IllegalArgumentException - if iter is nullpublic void initClassAttributeIterator(ClassReader.AttrIterator iter)
java.lang.IllegalArgumentException - if iter is null
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||