public class ClassReader
extends java.lang.Object
ClassVisitor
visit a ClassFile structure, as defined in the Java
Virtual Machine Specification (JVMS). This class parses the ClassFile content and calls the
appropriate visit methods of a given ClassVisitor
for each field, method and bytecode
instruction encountered.Modifier and Type | Field and Description |
---|---|
byte[] |
b
A byte array containing the JVMS ClassFile structure to be parsed.
|
private int[] |
bootstrapMethodOffsets
The start offsets in
b of each element of the bootstrap_methods array (in the
BootstrapMethods attribute). |
private ConstantDynamic[] |
constantDynamicValues
The ConstantDynamic objects corresponding to the CONSTANT_Dynamic constant pool items.
|
private java.lang.String[] |
constantUtf8Values
The String objects corresponding to the CONSTANT_Utf8 constant pool items.
|
private int[] |
cpInfoOffsets
The offset in bytes, in
b , of each cp_info entry of the ClassFile's constant_pool
array, plus one. |
(package private) static int |
EXPAND_ASM_INSNS
A flag to expand the ASM specific instructions into an equivalent sequence of standard bytecode
instructions.
|
static int |
EXPAND_FRAMES
A flag to expand the stack map frames.
|
int |
header
The offset in bytes, in
b , of the ClassFile's access_flags field. |
private static int |
INPUT_STREAM_DATA_CHUNK_SIZE
The size of the temporary byte array used to read class input streams chunk by chunk.
|
private int |
maxStringLength
A conservative estimate of the maximum length of the strings contained in the constant pool of
the class.
|
static int |
SKIP_CODE
A flag to skip the Code attributes.
|
static int |
SKIP_DEBUG
A flag to skip the SourceFile, SourceDebugExtension, LocalVariableTable, LocalVariableTypeTable
and LineNumberTable attributes.
|
static int |
SKIP_FRAMES
A flag to skip the StackMap and StackMapTable attributes.
|
Constructor and Description |
---|
ClassReader(byte[] classFile)
Constructs a new
ClassReader object. |
ClassReader(byte[] classFileBuffer,
int classFileOffset,
boolean checkClassVersion)
Constructs a new
ClassReader object. |
ClassReader(byte[] classFileBuffer,
int classFileOffset,
int classFileLength)
Constructs a new
ClassReader object. |
ClassReader(java.io.InputStream inputStream)
Constructs a new
ClassReader object. |
ClassReader(java.lang.String className)
Constructs a new
ClassReader object. |
Modifier and Type | Method and Description |
---|---|
void |
accept(ClassVisitor classVisitor,
Attribute[] attributePrototypes,
int parsingOptions)
Makes the given visitor visit the JVMS ClassFile structure passed to the constructor of this
ClassReader . |
void |
accept(ClassVisitor classVisitor,
int parsingOptions)
Makes the given visitor visit the JVMS ClassFile structure passed to the constructor of this
ClassReader . |
private void |
computeImplicitFrame(Context context)
Computes the implicit frame of the method currently being parsed (as defined in the given
Context ) and stores it in the given context. |
private void |
createDebugLabel(int bytecodeOffset,
Label[] labels)
Creates a label with the
Label.FLAG_DEBUG_ONLY flag set, if there is no already
existing label for the given bytecode offset (otherwise does nothing). |
private Label |
createLabel(int bytecodeOffset,
Label[] labels)
Creates a label without the
Label.FLAG_DEBUG_ONLY flag set, for the given bytecode
offset. |
int |
getAccess()
Returns the class's access flags (see
Opcodes ). |
java.lang.String |
getClassName()
Returns the internal name of the class (see
Type.getInternalName() ). |
(package private) int |
getFirstAttributeOffset()
Returns the offset in
b of the first ClassFile's 'attributes' array field entry. |
java.lang.String[] |
getInterfaces()
Returns the internal names of the implemented interfaces (see
Type.getInternalName() ). |
int |
getItem(int constantPoolEntryIndex)
Returns the start offset in
b of a JVMS 'cp_info' structure (i.e. |
int |
getItemCount()
Returns the number of entries in the class's constant pool table.
|
int |
getMaxStringLength()
Returns a conservative estimate of the maximum length of the strings contained in the class's
constant pool table.
|
java.lang.String |
getSuperName()
Returns the internal of name of the super class (see
Type.getInternalName() ). |
private int |
getTypeAnnotationBytecodeOffset(int[] typeAnnotationOffsets,
int typeAnnotationIndex)
Returns the bytecode offset corresponding to the specified JVMS 'type_annotation' structure, or
-1 if there is no such type_annotation of if it does not have a bytecode offset.
|
private Attribute |
readAttribute(Attribute[] attributePrototypes,
java.lang.String type,
int offset,
int length,
char[] charBuffer,
int codeAttributeOffset,
Label[] labels)
Reads a non standard JVMS 'attribute' structure in
b . |
private int[] |
readBootstrapMethodsAttribute(int maxStringLength)
Reads the BootstrapMethods attribute to compute the offset of each bootstrap method.
|
int |
readByte(int offset)
Reads a byte value in
b . |
java.lang.String |
readClass(int offset,
char[] charBuffer)
Reads a CONSTANT_Class constant pool entry in
b . |
private void |
readCode(MethodVisitor methodVisitor,
Context context,
int codeOffset)
Reads a JVMS 'Code' attribute and makes the given visitor visit it.
|
java.lang.Object |
readConst(int constantPoolEntryIndex,
char[] charBuffer)
Reads a numeric or string constant pool entry in
b . |
private ConstantDynamic |
readConstantDynamic(int constantPoolEntryIndex,
char[] charBuffer)
Reads a CONSTANT_Dynamic constant pool entry in
b . |
private int |
readElementValue(AnnotationVisitor annotationVisitor,
int elementValueOffset,
java.lang.String elementName,
char[] charBuffer)
Reads a JVMS 'element_value' structure and makes the given visitor visit it.
|
private int |
readElementValues(AnnotationVisitor annotationVisitor,
int annotationOffset,
boolean named,
char[] charBuffer)
Reads the element values of a JVMS 'annotation' structure and makes the given visitor visit
them.
|
private int |
readField(ClassVisitor classVisitor,
Context context,
int fieldInfoOffset)
Reads a JVMS field_info structure and makes the given visitor visit it.
|
int |
readInt(int offset)
Reads a signed int value in
b . |
protected Label |
readLabel(int bytecodeOffset,
Label[] labels)
Returns the label corresponding to the given bytecode offset.
|
long |
readLong(int offset)
Reads a signed long value in
b . |
private int |
readMethod(ClassVisitor classVisitor,
Context context,
int methodInfoOffset)
Reads a JVMS method_info structure and makes the given visitor visit it.
|
java.lang.String |
readModule(int offset,
char[] charBuffer)
Reads a CONSTANT_Module constant pool entry in
b . |
private void |
readModuleAttributes(ClassVisitor classVisitor,
Context context,
int moduleOffset,
int modulePackagesOffset,
java.lang.String moduleMainClass)
Reads the Module, ModulePackages and ModuleMainClass attributes and visit them.
|
java.lang.String |
readPackage(int offset,
char[] charBuffer)
Reads a CONSTANT_Package constant pool entry in
b . |
private void |
readParameterAnnotations(MethodVisitor methodVisitor,
Context context,
int runtimeParameterAnnotationsOffset,
boolean visible)
Reads a Runtime[In]VisibleParameterAnnotations attribute and makes the given visitor visit it.
|
short |
readShort(int offset)
Reads a signed short value in
b . |
private int |
readStackMapFrame(int stackMapFrameOffset,
boolean compressed,
boolean expand,
Context context)
Reads a JVMS 'stack_map_frame' structure and stores the result in the given
Context
object. |
private static byte[] |
readStream(java.io.InputStream inputStream,
boolean close)
Reads the given input stream and returns its content as a byte array.
|
private java.lang.String |
readStringish(int offset,
char[] charBuffer)
Reads a CONSTANT_Class, CONSTANT_String, CONSTANT_MethodType, CONSTANT_Module or
CONSTANT_Package constant pool entry in
b . |
private int[] |
readTypeAnnotations(MethodVisitor methodVisitor,
Context context,
int runtimeTypeAnnotationsOffset,
boolean visible)
Parses a Runtime[In]VisibleTypeAnnotations attribute to find the offset of each type_annotation
entry it contains, to find the corresponding labels, and to visit the try catch block
annotations.
|
private int |
readTypeAnnotationTarget(Context context,
int typeAnnotationOffset)
Parses the header of a JVMS type_annotation structure to extract its target_type, target_info
and target_path (the result is stored in the given context), and returns the start offset of
the rest of the type_annotation structure.
|
int |
readUnsignedShort(int offset)
Reads an unsigned short value in
b . |
(package private) java.lang.String |
readUtf(int constantPoolEntryIndex,
char[] charBuffer)
Reads a CONSTANT_Utf8 constant pool entry in
b . |
private java.lang.String |
readUtf(int utfOffset,
int utfLength,
char[] charBuffer)
Reads an UTF8 string in
b . |
java.lang.String |
readUTF8(int offset,
char[] charBuffer)
Reads a CONSTANT_Utf8 constant pool entry in
b . |
private int |
readVerificationTypeInfo(int verificationTypeInfoOffset,
java.lang.Object[] frame,
int index,
char[] charBuffer,
Label[] labels)
Reads a JVMS 'verification_type_info' structure and stores it at the given index in the given
array.
|
public static final int SKIP_CODE
public static final int SKIP_DEBUG
ClassVisitor.visitSource(java.lang.String, java.lang.String)
, MethodVisitor.visitLocalVariable(java.lang.String, java.lang.String, java.lang.String, org.springframework.asm.Label, org.springframework.asm.Label, int)
and
MethodVisitor.visitLineNumber(int, org.springframework.asm.Label)
are not called).public static final int SKIP_FRAMES
MethodVisitor.visitFrame(int, int, java.lang.Object[], int, java.lang.Object[])
is not called). This flag
is useful when the ClassWriter.COMPUTE_FRAMES
option is used: it avoids visiting frames
that will be ignored and recomputed from scratch.public static final int EXPAND_FRAMES
static final int EXPAND_ASM_INSNS
Label.resolve(byte[], int)
). This internal flag is used to re-read classes containing
such instructions, in order to replace them with standard instructions. In addition, when this
flag is used, goto_w and jsr_w are not converted into goto and jsr, to make sure that
infinite loops where a goto_w is replaced with a goto in ClassReader and converted back to a
goto_w in ClassWriter cannot occur.private static final int INPUT_STREAM_DATA_CHUNK_SIZE
public final byte[] b
Attribute
sub classes, and is normally
not needed by class visitors.
NOTE: the ClassFile structure can start at any offset within this array, i.e. it does not
necessarily start at offset 0. Use getItem(int)
and header
to get correct
ClassFile element offsets within this byte array.
private final int[] cpInfoOffsets
b
, of each cp_info entry of the ClassFile's constant_pool
array, plus one. In other words, the offset of constant pool entry i is given by
cpInfoOffsets[i] - 1, i.e. its cp_info's tag field is given by b[cpInfoOffsets[i] - 1].private final java.lang.String[] constantUtf8Values
private final ConstantDynamic[] constantDynamicValues
private final int[] bootstrapMethodOffsets
b
of each element of the bootstrap_methods array (in the
BootstrapMethods attribute).private final int maxStringLength
public final int header
b
, of the ClassFile's access_flags field.public ClassReader(byte[] classFile)
ClassReader
object.classFile
- the JVMS ClassFile structure to be read.public ClassReader(byte[] classFileBuffer, int classFileOffset, int classFileLength)
ClassReader
object.classFileBuffer
- a byte array containing the JVMS ClassFile structure to be read.classFileOffset
- the offset in byteBuffer of the first byte of the ClassFile to be read.classFileLength
- the length in bytes of the ClassFile to be read.ClassReader(byte[] classFileBuffer, int classFileOffset, boolean checkClassVersion)
ClassReader
object. This internal constructor must not be exposed
as a public API.classFileBuffer
- a byte array containing the JVMS ClassFile structure to be read.classFileOffset
- the offset in byteBuffer of the first byte of the ClassFile to be read.checkClassVersion
- whether to check the class version or not.public ClassReader(java.io.InputStream inputStream) throws java.io.IOException
ClassReader
object.inputStream
- an input stream of the JVMS ClassFile structure to be read. This input
stream must contain nothing more than the ClassFile structure itself. It is read from its
current position to its end.java.io.IOException
- if a problem occurs during reading.public ClassReader(java.lang.String className) throws java.io.IOException
ClassReader
object.className
- the fully qualified name of the class to be read. The ClassFile structure is
retrieved with the current class loader's ClassLoader.getSystemResourceAsStream(java.lang.String)
.java.io.IOException
- if an exception occurs during reading.private static byte[] readStream(java.io.InputStream inputStream, boolean close) throws java.io.IOException
inputStream
- an input stream.close
- true to close the input stream after reading.java.io.IOException
- if a problem occurs during reading.public int getAccess()
Opcodes
). This value may not reflect Deprecated
and Synthetic flags when bytecode is before 1.5 and those flags are represented by attributes.ClassVisitor.visit(int, int, String, String, String, String[])
public java.lang.String getClassName()
Type.getInternalName()
).ClassVisitor.visit(int, int, String, String, String, String[])
public java.lang.String getSuperName()
Type.getInternalName()
). For
interfaces, the super class is Object
.Object
class.ClassVisitor.visit(int, int, String, String, String, String[])
public java.lang.String[] getInterfaces()
Type.getInternalName()
).ClassVisitor.visit(int, int, String, String, String, String[])
public void accept(ClassVisitor classVisitor, int parsingOptions)
ClassReader
.classVisitor
- the visitor that must visit this class.parsingOptions
- the options to use to parse this class. One or more of SKIP_CODE
, SKIP_DEBUG
, SKIP_FRAMES
or EXPAND_FRAMES
.public void accept(ClassVisitor classVisitor, Attribute[] attributePrototypes, int parsingOptions)
ClassReader
.classVisitor
- the visitor that must visit this class.attributePrototypes
- prototypes of the attributes that must be parsed during the visit of
the class. Any attribute whose type is not equal to the type of one the prototypes will not
be parsed: its byte array value will be passed unchanged to the ClassWriter. This may
corrupt it if this value contains references to the constant pool, or has syntactic or
semantic links with a class element that has been transformed by a class adapter between
the reader and the writer.parsingOptions
- the options to use to parse this class. One or more of SKIP_CODE
, SKIP_DEBUG
, SKIP_FRAMES
or EXPAND_FRAMES
.private void readModuleAttributes(ClassVisitor classVisitor, Context context, int moduleOffset, int modulePackagesOffset, java.lang.String moduleMainClass)
classVisitor
- the current class visitorcontext
- information about the class being parsed.moduleOffset
- the offset of the Module attribute (excluding the attribute_info's
attribute_name_index and attribute_length fields).modulePackagesOffset
- the offset of the ModulePackages attribute (excluding the
attribute_info's attribute_name_index and attribute_length fields), or 0.moduleMainClass
- the string corresponding to the ModuleMainClass attribute, or null.private int readField(ClassVisitor classVisitor, Context context, int fieldInfoOffset)
classVisitor
- the visitor that must visit the field.context
- information about the class being parsed.fieldInfoOffset
- the start offset of the field_info structure.private int readMethod(ClassVisitor classVisitor, Context context, int methodInfoOffset)
classVisitor
- the visitor that must visit the method.context
- information about the class being parsed.methodInfoOffset
- the start offset of the method_info structure.private void readCode(MethodVisitor methodVisitor, Context context, int codeOffset)
methodVisitor
- the visitor that must visit the Code attribute.context
- information about the class being parsed.codeOffset
- the start offset in b
of the Code attribute, excluding its
attribute_name_index and attribute_length fields.protected Label readLabel(int bytecodeOffset, Label[] labels)
bytecodeOffset
- a bytecode offset in a method.labels
- the already created labels, indexed by their offset. If a label already exists
for bytecodeOffset this method must not create a new one. Otherwise it must store the new
label in this array.private Label createLabel(int bytecodeOffset, Label[] labels)
Label.FLAG_DEBUG_ONLY
flag set, for the given bytecode
offset. The label is created with a call to readLabel(int, org.springframework.asm.Label[])
and its Label.FLAG_DEBUG_ONLY
flag is cleared.bytecodeOffset
- a bytecode offset in a method.labels
- the already created labels, indexed by their offset.Label.FLAG_DEBUG_ONLY
flag set.private void createDebugLabel(int bytecodeOffset, Label[] labels)
Label.FLAG_DEBUG_ONLY
flag set, if there is no already
existing label for the given bytecode offset (otherwise does nothing). The label is created
with a call to readLabel(int, org.springframework.asm.Label[])
.bytecodeOffset
- a bytecode offset in a method.labels
- the already created labels, indexed by their offset.private int[] readTypeAnnotations(MethodVisitor methodVisitor, Context context, int runtimeTypeAnnotationsOffset, boolean visible)
methodVisitor
- the method visitor to be used to visit the try catch block annotations.context
- information about the class being parsed.runtimeTypeAnnotationsOffset
- the start offset of a Runtime[In]VisibleTypeAnnotations
attribute, excluding the attribute_info's attribute_name_index and attribute_length fields.visible
- true if the attribute to parse is a RuntimeVisibleTypeAnnotations attribute,
false it is a RuntimeInvisibleTypeAnnotations attribute.private int getTypeAnnotationBytecodeOffset(int[] typeAnnotationOffsets, int typeAnnotationIndex)
typeAnnotationOffsets
- the offset of each 'type_annotation' entry in a
Runtime[In]VisibleTypeAnnotations attribute, or null.typeAnnotationIndex
- the index a 'type_annotation' entry in typeAnnotationOffsets.private int readTypeAnnotationTarget(Context context, int typeAnnotationOffset)
context
- information about the class being parsed. This is where the extracted
target_type and target_path must be stored.typeAnnotationOffset
- the start offset of a type_annotation structure.private void readParameterAnnotations(MethodVisitor methodVisitor, Context context, int runtimeParameterAnnotationsOffset, boolean visible)
methodVisitor
- the visitor that must visit the parameter annotations.context
- information about the class being parsed.runtimeParameterAnnotationsOffset
- the start offset of a
Runtime[In]VisibleParameterAnnotations attribute, excluding the attribute_info's
attribute_name_index and attribute_length fields.visible
- true if the attribute to parse is a RuntimeVisibleParameterAnnotations
attribute, false it is a RuntimeInvisibleParameterAnnotations attribute.private int readElementValues(AnnotationVisitor annotationVisitor, int annotationOffset, boolean named, char[] charBuffer)
annotationVisitor
- the visitor that must visit the values.annotationOffset
- the start offset of an 'annotation' structure (excluding its type_index
field) or of an 'array_value' structure.named
- if the annotation values are named or not. This should be true to parse the values
of a JVMS 'annotation' structure, and false to parse the JVMS 'array_value' of an
annotation's element_value.charBuffer
- the buffer used to read strings in the constant pool.private int readElementValue(AnnotationVisitor annotationVisitor, int elementValueOffset, java.lang.String elementName, char[] charBuffer)
annotationVisitor
- the visitor that must visit the element_value structure.elementValueOffset
- the start offset in b
of the element_value structure to be
read.elementName
- the name of the element_value structure to be read, or null.charBuffer
- the buffer used to read strings in the constant pool.private void computeImplicitFrame(Context context)
Context
) and stores it in the given context.context
- information about the class being parsed.private int readStackMapFrame(int stackMapFrameOffset, boolean compressed, boolean expand, Context context)
Context
object. This method can also be used to read a full_frame structure, excluding its frame_type
field (this is used to parse the legacy StackMap attributes).stackMapFrameOffset
- the start offset in b
of the stack_map_frame_value
structure to be read, or the start offset of a full_frame structure (excluding its
frame_type field).compressed
- true to read a 'stack_map_frame' structure, false to read a 'full_frame'
structure without its frame_type field.expand
- if the stack map frame must be expanded. See EXPAND_FRAMES
.context
- where the parsed stack map frame must be stored.private int readVerificationTypeInfo(int verificationTypeInfoOffset, java.lang.Object[] frame, int index, char[] charBuffer, Label[] labels)
verificationTypeInfoOffset
- the start offset of the 'verification_type_info' structure to
read.frame
- the array where the parsed type must be stored.index
- the index in 'frame' where the parsed type must be stored.charBuffer
- the buffer used to read strings in the constant pool.labels
- the labels of the method currently being parsed, indexed by their offset. If the
parsed type is an ITEM_Uninitialized, a new label for the corresponding NEW instruction is
stored in this array if it does not already exist.final int getFirstAttributeOffset()
b
of the first ClassFile's 'attributes' array field entry.b
of the first ClassFile's 'attributes' array field entry.private int[] readBootstrapMethodsAttribute(int maxStringLength)
maxStringLength
- a conservative estimate of the maximum length of the strings contained
in the constant pool of the class.private Attribute readAttribute(Attribute[] attributePrototypes, java.lang.String type, int offset, int length, char[] charBuffer, int codeAttributeOffset, Label[] labels)
b
.attributePrototypes
- prototypes of the attributes that must be parsed during the visit of
the class. Any attribute whose type is not equal to the type of one the prototypes will not
be parsed: its byte array value will be passed unchanged to the ClassWriter.type
- the type of the attribute.offset
- the start offset of the JVMS 'attribute' structure in b
. The 6 attribute
header bytes (attribute_name_index and attribute_length) are not taken into account here.length
- the length of the attribute's content (excluding the 6 attribute header bytes).charBuffer
- the buffer to be used to read strings in the constant pool.codeAttributeOffset
- the start offset of the enclosing Code attribute in b
, or
-1 if the attribute to be read is not a code attribute. The 6 attribute header bytes
(attribute_name_index and attribute_length) are not taken into account here.labels
- the labels of the method's code, or null if the attribute to be read
is not a code attribute.public int getItemCount()
public int getItem(int constantPoolEntryIndex)
b
of a JVMS 'cp_info' structure (i.e. a constant pool
entry), plus one. This method is intended for Attribute
sub classes, and is normally
not needed by class generators or adapters.constantPoolEntryIndex
- the index a constant pool entry in the class's constant pool
table.b
of the corresponding JVMS 'cp_info' structure, plus one.public int getMaxStringLength()
public int readByte(int offset)
b
. This method is intended for Attribute
sub classes,
and is normally not needed by class generators or adapters.offset
- the start offset of the value to be read in b
.public int readUnsignedShort(int offset)
b
. This method is intended for Attribute
sub classes, and is normally not needed by class generators or adapters.offset
- the start index of the value to be read in b
.public short readShort(int offset)
b
. This method is intended for Attribute
sub
classes, and is normally not needed by class generators or adapters.offset
- the start offset of the value to be read in b
.public int readInt(int offset)
b
. This method is intended for Attribute
sub
classes, and is normally not needed by class generators or adapters.offset
- the start offset of the value to be read in b
.public long readLong(int offset)
b
. This method is intended for Attribute
sub
classes, and is normally not needed by class generators or adapters.offset
- the start offset of the value to be read in b
.public java.lang.String readUTF8(int offset, char[] charBuffer)
b
. This method is intended for Attribute
sub classes, and is normally not needed by class generators or adapters.offset
- the start offset of an unsigned short value in b
, whose value is the
index of a CONSTANT_Utf8 entry in the class's constant pool table.charBuffer
- the buffer to be used to read the string. This buffer must be sufficiently
large. It is not automatically resized.final java.lang.String readUtf(int constantPoolEntryIndex, char[] charBuffer)
b
.constantPoolEntryIndex
- the index of a CONSTANT_Utf8 entry in the class's constant pool
table.charBuffer
- the buffer to be used to read the string. This buffer must be sufficiently
large. It is not automatically resized.private java.lang.String readUtf(int utfOffset, int utfLength, char[] charBuffer)
b
.utfOffset
- the start offset of the UTF8 string to be read.utfLength
- the length of the UTF8 string to be read.charBuffer
- the buffer to be used to read the string. This buffer must be sufficiently
large. It is not automatically resized.private java.lang.String readStringish(int offset, char[] charBuffer)
b
. This method is intended for Attribute
sub classes, and is normally not needed by class generators or adapters.offset
- the start offset of an unsigned short value in b
, whose value is the
index of a CONSTANT_Class, CONSTANT_String, CONSTANT_MethodType, CONSTANT_Module or
CONSTANT_Package entry in class's constant pool table.charBuffer
- the buffer to be used to read the item. This buffer must be sufficiently
large. It is not automatically resized.public java.lang.String readClass(int offset, char[] charBuffer)
b
. This method is intended for Attribute
sub classes, and is normally not needed by class generators or adapters.offset
- the start offset of an unsigned short value in b
, whose value is the
index of a CONSTANT_Class entry in class's constant pool table.charBuffer
- the buffer to be used to read the item. This buffer must be sufficiently
large. It is not automatically resized.public java.lang.String readModule(int offset, char[] charBuffer)
b
. This method is intended for
Attribute
sub classes, and is normally not needed by class generators or adapters.offset
- the start offset of an unsigned short value in b
, whose value is the
index of a CONSTANT_Module entry in class's constant pool table.charBuffer
- the buffer to be used to read the item. This buffer must be sufficiently
large. It is not automatically resized.public java.lang.String readPackage(int offset, char[] charBuffer)
b
. This method is intended for
Attribute
sub classes, and is normally not needed by class generators or adapters.offset
- the start offset of an unsigned short value in b
, whose value is the
index of a CONSTANT_Package entry in class's constant pool table.charBuffer
- the buffer to be used to read the item. This buffer must be sufficiently
large. It is not automatically resized.private ConstantDynamic readConstantDynamic(int constantPoolEntryIndex, char[] charBuffer)
b
.constantPoolEntryIndex
- the index of a CONSTANT_Dynamic entry in the class's constant
pool table.charBuffer
- the buffer to be used to read the string. This buffer must be sufficiently
large. It is not automatically resized.public java.lang.Object readConst(int constantPoolEntryIndex, char[] charBuffer)
b
. This method is intended for
Attribute
sub classes, and is normally not needed by class generators or adapters.constantPoolEntryIndex
- the index of a CONSTANT_Integer, CONSTANT_Float, CONSTANT_Long,
CONSTANT_Double, CONSTANT_Class, CONSTANT_String, CONSTANT_MethodType,
CONSTANT_MethodHandle or CONSTANT_Dynamic entry in the class's constant pool.charBuffer
- the buffer to be used to read strings. This buffer must be sufficiently
large. It is not automatically resized.Integer
, Float
, Long
, Double
, String
,
Type
, Handle
or ConstantDynamic
corresponding to the specified
constant pool entry.