attribute_info {
u2 attribute_name_index;
u4 attribute_length;
u1 info[attribute_length];
}
ConstantValue, SourceFile, Code, Unknown, ExceptionTable, LineNumberTable, LocalVariableTable, InnerClasses, Synthetic, Deprecated, Signature
| Modifier and Type | Field and Description |
|---|---|
| protected ConstantPool | constant_pool
Deprecated
(since 6.0) will be made private; do not access directly, use getter/setter
|
| private static final boolean | |
| public static final Attribute[] | EMPTY_ARRAY
Empty array. |
| protected int | length
Deprecated
(since 6.0) (since 6.0) will be made private; do not access directly, use getter/setter
|
| protected int | name_index
Deprecated
(since 6.0) will be made private; do not access directly, use getter/setter
|
| private static final Map | |
| protected byte | tag
Deprecated
(since 6.0) will be made private; do not access directly, use getter/setter
|
| Access | Constructor and Description |
|---|---|
| protected | Attribute(final byte
tag. tag, final int u2 name index. nameIndex, final int u4 length. length, final ConstantPool constant pool. constantPool)Constructs an instance. |
| Modifier and Type | Method and Description |
|---|---|
| public abstract void | accept(Visitor
Visitor object v)Redeclares com. Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. |
| public static void | addAttributeReader(final String
the name of the attribute as stored in the class file name, final UnknownAttributeReader the reader object unknownAttributeReader)Add an Attribute reader capable of parsing (user-defined) attributes named "name". |
| public Object | Returns: shallow copy of this attributeOverrides java. Use copy() if you want to have a deep copy(), i.e., with all references copied correctly. |
| public abstract Attribute | |
| public void | |
| public final ConstantPool | |
| public final int | |
| public String | |
| public final int | |
| public final byte | |
| protected static void | |
| public static Attribute | Returns: AttributeInput stream dataInput, final ConstantPool Array of constants constantPool)Class method reads one attribute from the input data stream. |
| public static Attribute | Returns: AttributeInput stream dataInputStream, final ConstantPool Array of constants constantPool)Class method reads one attribute from the input data stream. |
| public static void | removeAttributeReader(final String
the name of the attribute as stored in the class file name)Remove attribute reader |
| public final void | |
| public final void | |
| public final void | |
| public String | Returns: attribute name.Overrides java. Returns a string representation of the object. |
| constant_pool | back to summary |
|---|---|
| protected ConstantPool constant_pool
Deprecated (since 6.0) will be made private; do not access directly, use getter/setter | |
| debug | back to summary |
|---|---|
| private static final boolean debug | |
| EMPTY_ARRAY | back to summary |
|---|---|
| public static final Attribute[] EMPTY_ARRAY Empty array.
| |
| length | back to summary |
|---|---|
| protected int length
Deprecated (since 6.0) (since 6.0) will be made private; do not access directly, use getter/setter | |
| name_index | back to summary |
|---|---|
| protected int name_index
Deprecated (since 6.0) will be made private; do not access directly, use getter/setter | |
| READERS | back to summary |
|---|---|
| private static final Map<String, Object> READERS | |
| tag | back to summary |
|---|---|
| protected byte tag
Deprecated (since 6.0) will be made private; do not access directly, use getter/setter | |
| Attribute | back to summary |
|---|---|
| protected Attribute(final byte tag, final int nameIndex, final int length, final ConstantPool constantPool) Constructs an instance.
attribute_info {
u2 attribute_name_index;
u4 attribute_length;
u1 info[attribute_length];
}
| |
| accept | back to summary |
|---|---|
| public abstract void accept(Visitor v) Redeclares com. Called by objects that are traversing the nodes of the tree implicitly defined by the contents of a Java class. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects. | |
| addAttributeReader | back to summary |
|---|---|
| public static void addAttributeReader(final String name, final UnknownAttributeReader unknownAttributeReader) Add an Attribute reader capable of parsing (user-defined) attributes named "name". You should not add readers for the standard attributes such as "LineNumberTable", because those are handled internally.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Use copy() if you want to have a deep copy(), i.e., with all references copied correctly. | |
| copy | back to summary |
|---|---|
public abstract Attribute copy(ConstantPool constantPool)
| |
| dump | back to summary |
|---|---|
| public void dump(final DataOutputStream file) throws IOException Dumps attribute to file stream in binary format.
| |
| getConstantPool | back to summary |
|---|---|
public final ConstantPool getConstantPool()
| |
| getLength | back to summary |
|---|---|
public final int getLength()
| |
| getName | back to summary |
|---|---|
public String getName()
| |
| getNameIndex | back to summary |
|---|---|
public final int getNameIndex()
| |
| getTag | back to summary |
|---|---|
public final byte getTag()
| |
| println | back to summary |
|---|---|
| protected static void println(final String msg) | |
| readAttribute | back to summary |
|---|---|
| public static Attribute readAttribute(final DataInput dataInput, final ConstantPool constantPool) throws IOException Class method reads one attribute from the input data stream. This method must not be accessible from the outside. It is called by the Field and Method constructor methods.
| |
| readAttribute | back to summary |
|---|---|
| public static Attribute readAttribute(final DataInputStream dataInputStream, final ConstantPool constantPool) throws IOException Class method reads one attribute from the input data stream. This method must not be accessible from the outside. It is called by the Field and Method constructor methods.
| |
| removeAttributeReader | back to summary |
|---|---|
| public static void removeAttributeReader(final String name) Remove attribute reader
| |
| setConstantPool | back to summary |
|---|---|
public final void setConstantPool(final ConstantPool constantPool)
| |
| setLength | back to summary |
|---|---|
public final void setLength(final int length)
| |
| setNameIndex | back to summary |
|---|---|
public final void setNameIndex(final int nameIndex)
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |