All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class de.fub.bytecode.classfile.Attribute

java.lang.Object
   |
   +----de.fub.bytecode.classfile.Attribute

public abstract class Attribute
extends Object
implements Constants, Cloneable
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.

Version:
$Id: Attribute.java,v 1.2 1999/05/04 13:11:56 dahm Exp $
Author:
M. Dahm
See Also:
ConstantValue, SourceFile, Code, Unknown, ExceptionTable, LineNumberTable, LocalVariableTable, InnerClasses, Synthetic, Deprecated

Variable Index

 o constant_pool
 o length
 o name_index
 o tag

Method Index

 o accept(Visitor)
Called by objects that are traversing the nodes of the tree implicitely defined by the contents of a Java class.
 o clone()
Use copy() if you want to have a deep copy(), i.e.
 o copy(ConstantPool)
 o dump(DataOutputStream)
Dump attribute to file stream in binary format.
 o getConstantPool()
 o getLength()
 o getNameIndex()
 o getTag()
 o setConstantPool(ConstantPool)
 o setLength(int)
 o setNameIndex(int)
 o toString()

Variables

 o name_index
 protected int name_index
 o length
 protected int length
 o tag
 protected byte tag
 o constant_pool
 protected ConstantPool constant_pool

Methods

 o accept
 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.

Parameters:
v - Visitor object
 o dump
 public void dump(DataOutputStream file) throws IOException
Dump attribute to file stream in binary format.

Parameters:
file - Output file stream
 o getLength
 public final int getLength()
Returns:
Length of attribute field in bytes.
 o setLength
 public final void setLength(int length)
Parameters:
Attribute - length in bytes.
 o setNameIndex
 public final void setNameIndex(int name_index)
Parameters:
name_index - of attribute.
 o getNameIndex
 public final int getNameIndex()
Returns:
Name index in constant pool of attribute name.
 o getTag
 public final byte getTag()
Returns:
Tag of attribute, i.e. its type. Value may not be altered, thus there is no setTag() method.
 o getConstantPool
 public final ConstantPool getConstantPool()
Returns:
Constant pool used by this object.
See Also:
ConstantPool
 o setConstantPool
 public final void setConstantPool(ConstantPool constant_pool)
Parameters:
constant_pool - Constant pool to be used for this object.
See Also:
ConstantPool
 o clone
 public Object clone()
Use copy() if you want to have a deep copy(), i.e. with all references copied correctly.

Returns:
shallow copy of this attribute
Overrides:
clone in class Object
 o copy
 public abstract Attribute copy(ConstantPool constant_pool)
Returns:
deep copy of this attribute
 o toString
 public String toString()
Returns:
attribute name.
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index