public final class ClassReader extends Object implements ClassConstants
| Modifier and Type | Class and Description |
|---|---|
static class |
ClassReader.AttrIterator
AttrIterator provides access to attributes in the class file.
|
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_InvokeDynamic, CONSTANT_Long, CONSTANT_MethodHandle, CONSTANT_MethodRef, CONSTANT_MethodType, CONSTANT_NameAndType, CONSTANT_String, CONSTANT_Utf8, MAGIC, REF_getField, REF_getStatic, REF_invokeInterface, REF_invokeSpecial, REF_invokeStatic, REF_invokeVirtual, REF_newInvokeSpecial, REF_putField, REF_putStatic| Constructor and Description |
|---|
ClassReader(byte[] bytes)
Build a reader.
|
public ClassReader(byte[] bytes)
throws InvalidClassFileException
bytes - the class file dataInvalidClassFileException - the class file data is corruptpublic byte[] getBytes()
public int getMagic()
public int getMinorVersion()
public int getMajorVersion()
public int getAccessFlags()
public int getNameIndex()
public String getName() throws InvalidClassFileException
InvalidClassFileExceptionpublic int getSuperNameIndex()
public String getSuperName() throws InvalidClassFileException
InvalidClassFileExceptionpublic int getInterfaceCount()
public int getInterfaceNameIndex(int i)
public int[] getInterfaceNameIndices()
public String getInterfaceName(int i) throws InvalidClassFileException
InvalidClassFileExceptionpublic 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 getUnsignedByte(int i)
public int getFieldCount()
public int getFieldAccessFlags(int f)
public String getFieldName(int f) throws InvalidClassFileException
InvalidClassFileExceptionpublic String getFieldType(int f) throws InvalidClassFileException
InvalidClassFileExceptionpublic int getFieldNameIndex(int f)
public int getFieldTypeIndex(int f)
public void initFieldAttributeIterator(int f,
ClassReader.AttrIterator iter)
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 String getMethodName(int m) throws InvalidClassFileException
InvalidClassFileExceptionpublic String getMethodType(int m) throws InvalidClassFileException
InvalidClassFileExceptionpublic int getMethodNameIndex(int m)
public int getMethodTypeIndex(int m)
public void initMethodAttributeIterator(int m,
ClassReader.AttrIterator iter)
IllegalArgumentException - if iter is nullpublic void initClassAttributeIterator(ClassReader.AttrIterator iter)
IllegalArgumentException - if iter is nullCopyright © 2019. All rights reserved.