public class Attribute
extends java.lang.Object
限定符和类型 | 字段和说明 |
---|---|
java.lang.String |
type
The type of this attribute.
|
byte[] |
value
The raw value of this attribute, used only for unknown attributes.
|
构造器和说明 |
---|
Attribute(java.lang.String type)
Constructs a new empty attribute.
|
限定符和类型 | 方法和说明 |
---|---|
protected Label[] |
getLabels()
Returns the labels corresponding to this attribute.
|
boolean |
isCodeAttribute()
Returns true if this type of attribute is a code attribute.
|
boolean |
isUnknown()
Returns true if this type of attribute is unknown.
|
protected ByteVector |
write(ClassWriter cw,
byte[] code,
int len,
int maxStack,
int maxLocals)
Returns the byte array form of this attribute.
|
public final java.lang.String type
public byte[] value
public Attribute(java.lang.String type)
type
- the type of the attribute.public boolean isUnknown()
public boolean isCodeAttribute()
protected Label[] getLabels()
protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals)
cw
- the class to which this attribute must be added. This parameter
can be used to add to the constant pool of this class the items
that corresponds to this attribute.code
- the bytecode of the method corresponding to this code
attribute, or null if this attribute is not a code
attributes.len
- the length of the bytecode of the method corresponding to this
code attribute, or null if this attribute is not a code
attribute.maxStack
- the maximum stack size of the method corresponding to
this code attribute, or -1 if this attribute is not a code
attribute.maxLocals
- the maximum number of local variables of the method
corresponding to this code attribute, or -1 if this attribute is
not a code attribute.