javassist.bytecode
Class AttributeInfo

java.lang.Object
  extended by javassist.bytecode.AttributeInfo
Direct Known Subclasses:
AnnotationDefaultAttribute, AnnotationsAttribute, CodeAttribute, ConstantAttribute, DeprecatedAttribute, EnclosingMethodAttribute, ExceptionsAttribute, InnerClassesAttribute, LineNumberAttribute, LocalVariableAttribute, ParameterAnnotationsAttribute, SignatureAttribute, SourceFileAttribute, StackMapTable, SyntheticAttribute

public class AttributeInfo
extends java.lang.Object

attribute_info structure.


Field Summary
protected  ConstPool constPool
           
 
Constructor Summary
protected AttributeInfo(ConstPool cp, int attrname, byte[] attrinfo)
           
protected AttributeInfo(ConstPool cp, int n, java.io.DataInputStream in)
           
protected AttributeInfo(ConstPool cp, java.lang.String attrname)
           
  AttributeInfo(ConstPool cp, java.lang.String attrname, byte[] attrinfo)
          Constructs an attribute_info structure.
 
Method Summary
 AttributeInfo copy(ConstPool newCp, java.util.Map classnames)
          Makes a copy.
 byte[] get()
          Returns the info field of this attribute_info structure.
 ConstPool getConstPool()
          Returns a constant pool table.
 java.lang.String getName()
          Returns an attribute name.
 int length()
          Returns the length of this attribute_info structure.
 void set(byte[] newinfo)
          Sets the info field of this attribute_info structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

constPool

protected ConstPool constPool
Constructor Detail

AttributeInfo

protected AttributeInfo(ConstPool cp,
                        int attrname,
                        byte[] attrinfo)

AttributeInfo

protected AttributeInfo(ConstPool cp,
                        java.lang.String attrname)

AttributeInfo

public AttributeInfo(ConstPool cp,
                     java.lang.String attrname,
                     byte[] attrinfo)
Constructs an attribute_info structure.

Parameters:
cp - constant pool table
attrname - attribute name
attrinfo - info field of attribute_info structure.

AttributeInfo

protected AttributeInfo(ConstPool cp,
                        int n,
                        java.io.DataInputStream in)
                 throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getName

public java.lang.String getName()
Returns an attribute name.


getConstPool

public ConstPool getConstPool()
Returns a constant pool table.


length

public int length()
Returns the length of this attribute_info structure. The returned value is attribute_length + 6.


get

public byte[] get()
Returns the info field of this attribute_info structure.

This method is not available if the object is an instance of CodeAttribute.


set

public void set(byte[] newinfo)
Sets the info field of this attribute_info structure.

This method is not available if the object is an instance of CodeAttribute.


copy

public AttributeInfo copy(ConstPool newCp,
                          java.util.Map classnames)
Makes a copy. Class names are replaced according to the given Map object.

Parameters:
newCp - the constant pool table used by the new copy.
classnames - pairs of replaced and substituted class names.


Copyright © 2011. All Rights Reserved.