Class: com.sun.org.apache.bcel.internal.classfile.Attribute
- public abstract class Attribute
- implements Cloneable, Node, Serializable
Abstract super class for Attribute objects. Currently the
ConstantValue, SourceFile, Code,
Exceptiontable, LineNumberTable,
LocalVariableTable, InnerClasses and
Synthetic attributes are supported. The
Unknown attribute stands for non-standard-attributes.
Inheritance
Superclass tree:- java.lang.Object
- com.sun.org.apache.bcel.internal.classfile.Attribute
Methods
-
Attributetop
protected Attribute(byte tag, int name_index, int length, ConstantPool constant_pool) -
accepttop
public 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. I.e., the hierarchy of methods, fields, attributes, etc. spawns a tree of objects. -
addAttributeReadertop
public static void addAttributeReader(String name, AttributeReader r)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. -
clonetop
public Object clone()Use copy() if you want to have a deep copy(), i.e., with all references copied correctly. -
copytop
public abstract Attribute copy(ConstantPool constant_pool) -
dumptop
public void dump(DataOutputStream file) throws IOExceptionDump attribute to file stream in binary format. -
getConstantPooltop
public final ConstantPool getConstantPool() -
getLengthtop
public final int getLength() -
getNameIndextop
public final int getNameIndex() -
getTagtop
public final byte getTag() -
readAttributetop
public static final Attribute readAttribute(DataInputStream file, ConstantPool constant_pool) throws IOException, ClassFormatException -
removeAttributeReadertop
public static void removeAttributeReader(String name)Remove attribute reader -
setConstantPooltop
public final void setConstantPool(ConstantPool constant_pool) -
setLengthtop
public final void setLength(int length) -
setNameIndextop
public final void setNameIndex(int name_index) -
toStringtop
public String toString()Returns a string representation of the object. In general, thetoStringmethod returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.The
toStringmethod for classObjectreturns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:getClass().getName() + '@' + Integer.toHexString(hashCode())
Fields
-
constant_pool
protected ConstantPool constant_pool -
length
protected int length -
name_index
protected int name_index -
readers
static private HashMap readers -
tag
protected byte tag
