javassist.bytecode

Class AttributeInfo

public class AttributeInfo extends Object

attribute_info structure.
Constructor Summary
AttributeInfo(ConstPool cp, String attrname, byte[] attrinfo)
Constructs an attribute_info structure.
Method Summary
AttributeInfocopy(ConstPool newCp, Map classnames)
Makes a copy.
byte[]get()
Returns the info field of this attribute_info structure.
ConstPoolgetConstPool()
Returns a constant pool table.
StringgetName()
Returns an attribute name.
intlength()
Returns the length of this attribute_info structure.
voidset(byte[] newinfo)
Sets the info field of this attribute_info structure.

Constructor Detail

AttributeInfo

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

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

Method Detail

copy

public AttributeInfo copy(ConstPool newCp, 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.

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.

getConstPool

public ConstPool getConstPool()
Returns a constant pool table.

getName

public String getName()
Returns an attribute name.

length

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

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.

Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.