Apache Tomcat 7.0.28

org.apache.tomcat.util.bcel.classfile
Class Attribute

java.lang.Object
  extended by org.apache.tomcat.util.bcel.classfile.Attribute
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
AnnotationDefault, Annotations, Code, ConstantValue, Deprecated, EnclosingMethod, ExceptionTable, InnerClasses, LineNumberTable, LocalVariableTable, LocalVariableTypeTable, ParameterAnnotations, PMGClass, Signature, SourceFile, StackMap, StackMapTable, Synthetic, Unknown

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

Version:
$Id: Attribute.java 992416 2010-09-03 18:50:57Z markt $
Author:
M. Dahm
See Also:
ConstantValue, SourceFile, Code, Unknown, ExceptionTable, LineNumberTable, LocalVariableTable, InnerClasses, Synthetic, Deprecated, Signature, Serialized Form

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
 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.
 String getName()
           
 byte getTag()
           
static Attribute readAttribute(DataInputStream file, ConstantPool constant_pool)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name_index

protected int name_index

length

protected int length

tag

protected byte tag

constant_pool

protected ConstantPool constant_pool
Constructor Detail

Attribute

protected Attribute(byte tag,
                    int name_index,
                    int length,
                    ConstantPool constant_pool)
Method Detail

dump

public void dump(DataOutputStream file)
          throws IOException
Dump attribute to file stream in binary format.

Parameters:
file - Output file stream
Throws:
IOException

readAttribute

public static final Attribute readAttribute(DataInputStream file,
                                            ConstantPool constant_pool)
                                     throws IOException,
                                            ClassFormatException
Throws:
IOException
ClassFormatException

getName

public String getName()
Returns:
Name of attribute

getTag

public final byte getTag()
Returns:
Tag of attribute, i.e., its type. Value may not be altered, thus there is no setTag() method.

clone

public Object clone()
Use copy() if you want to have a deep copy(), i.e., with all references copied correctly.

Overrides:
clone in class Object
Returns:
shallow copy of this attribute

copy

public abstract Attribute copy(ConstantPool _constant_pool)
Returns:
deep copy of this attribute

toString

public String toString()
Overrides:
toString in class Object
Returns:
attribute name.

Apache Tomcat 7.0.28

Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.