org.apache.tomcat.util.bcel.classfile
Class Attribute
java.lang.Object
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
Constructor Summary |
protected |
Attribute(byte tag,
int name_index,
int length,
ConstantPool constant_pool)
|
name_index
protected int name_index
length
protected int length
tag
protected byte tag
constant_pool
protected ConstantPool constant_pool
Attribute
protected Attribute(byte tag,
int name_index,
int length,
ConstantPool constant_pool)
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.
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.