org.apache.bcel.classfile
public abstract class Attribute extends Object implements Cloneable, Node, Serializable
See Also: ConstantValue SourceFile Code Unknown ExceptionTable LineNumberTable LocalVariableTable InnerClasses Synthetic Deprecated Signature
Field Summary | |
---|---|
protected ConstantPool | constant_pool |
protected int | length |
protected int | name_index |
protected byte | tag |
Constructor Summary | |
---|---|
protected | Attribute(byte tag, int name_index, int length, ConstantPool constant_pool) |
Method Summary | |
---|---|
abstract void | accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class. |
static void | addAttributeReader(String name, AttributeReader r) Add an Attribute reader capable of parsing (user-defined) attributes
named "name". |
Object | clone()
Use copy() if you want to have a deep copy(), i.e., with all references
copied correctly.
|
abstract Attribute | copy(ConstantPool _constant_pool) |
void | dump(DataOutputStream file)
Dump attribute to file stream in binary format.
|
ConstantPool | getConstantPool() |
int | getLength() |
int | getNameIndex() |
byte | getTag() |
static Attribute | readAttribute(DataInputStream file, ConstantPool constant_pool) |
static void | removeAttributeReader(String name) Remove attribute reader
|
void | setConstantPool(ConstantPool constant_pool) |
void | setLength(int length) |
void | setNameIndex(int name_index) |
String | toString() |
Parameters: v Visitor object
Parameters: name the name of the attribute as stored in the class file r the reader object
Returns: shallow copy of this attribute
Returns: deep copy of this attribute
Parameters: file Output file stream
Throws: IOException
Returns: Constant pool used by this object.
See Also: ConstantPool
Returns: Length of attribute field in bytes.
Returns: Name index in constant pool of attribute name.
Returns: Tag of attribute, i.e., its type. Value may not be altered, thus there is no setTag() method.
Parameters: name the name of the attribute as stored in the class file
Parameters: constant_pool Constant pool to be used for this object.
See Also: ConstantPool
Parameters: length length in bytes.
Parameters: name_index of attribute.
Returns: attribute name.