Top Description Fields Constructors Methods
javassist.bytecode

public Class AttributeInfo

extends Object
Class Inheritance
Known Direct Subclasses
javassist.bytecode.BootstrapMethodsAttribute, javassist.bytecode.CodeAttribute, javassist.bytecode.ConstantAttribute, javassist.bytecode.DeprecatedAttribute, javassist.bytecode.EnclosingMethodAttribute, javassist.bytecode.ExceptionsAttribute, javassist.bytecode.InnerClassesAttribute, javassist.bytecode.LineNumberAttribute, javassist.bytecode.LocalVariableAttribute, javassist.bytecode.MethodParametersAttribute, javassist.bytecode.NestHostAttribute, javassist.bytecode.NestMembersAttribute, javassist.bytecode.ParameterAnnotationsAttribute, javassist.bytecode.SignatureAttribute, javassist.bytecode.SourceFileAttribute, javassist.bytecode.StackMap, javassist.bytecode.StackMapTable, javassist.bytecode.SyntheticAttribute, javassist.bytecode.TypeAnnotationsAttribute, javassist.bytecode.AnnotationDefaultAttribute, javassist.bytecode.AnnotationsAttribute
Imports
java.io.DataInputStream, .DataOutputStream, .IOException, java.util.ArrayList, .Arrays, .List, .Map

attribute_info structure.
See Also
ClassFile#getAttribute(String), MethodInfo#getAttribute(String), FieldInfo#getAttribute(String)

Field Summary

Modifier and TypeField and Description
protected ConstPool
pack-priv byte[]
pack-priv int

Constructor Summary

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

protected
public
AttributeInfo(ConstPool
constant pool table
cp
,
String
attribute name
attrname
,
byte[]
info field of attribute_info structure.
attrinfo
)

Constructs an attribute_info structure.

protected

Method Summary

Modifier and TypeMethod and Description
public AttributeInfo
copy(ConstPool
the constant pool table used by the new copy.
newCp
,
Map<String, String>
pairs of replaced and substituted class names.
classnames
)

Makes a copy.

pack-priv static List<AttributeInfo>
public byte[]
get()

Returns the info field of this attribute_info structure.

public ConstPool
getConstPool()

Returns a constant pool table.

pack-priv static int
public String
getName()

Returns an attribute name.

pack-priv void
pack-priv static void
getRefClasses(List<AttributeInfo> attributes, Map<String, String> classnames)

public int
length()

Returns the length of this attribute_info structure.

pack-priv static AttributeInfo
lookup(List<AttributeInfo> attributes, String name)

pack-priv static AttributeInfo
pack-priv static synchronized AttributeInfo
remove(List<AttributeInfo> attributes, String name)

pack-priv void
renameClass(String oldname, String newname)

pack-priv void
renameClass(Map<String, String> classnames)

pack-priv static void
renameClass(List<AttributeInfo> attributes, String oldname, String newname)

pack-priv static void
renameClass(List<AttributeInfo> attributes, Map<String, String> classnames)

public void
set(byte[] newinfo)

Sets the info field of this attribute_info structure.

pack-priv void
pack-priv static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

constPoolback to summary
protected ConstPool constPool
infoback to summary
pack-priv byte[] info
nameback to summary
pack-priv int name

Constructor Detail

AttributeInfoback to summary
protected AttributeInfo(ConstPool cp, int attrname, byte[] attrinfo)
AttributeInfoback to summary
protected AttributeInfo(ConstPool cp, String attrname)
AttributeInfoback to summary
public AttributeInfo(ConstPool cp, String attrname, byte[] attrinfo)

Constructs an attribute_info structure.

Parameters
cp:ConstPool

constant pool table

attrname:String

attribute name

attrinfo:byte[]

info field of attribute_info structure.

AttributeInfoback to summary
protected AttributeInfo(ConstPool cp, int n, DataInputStream in) throws IOException

Method Detail

copyback to summary
public AttributeInfo copy(ConstPool newCp, Map<String, String> classnames)

Makes a copy. Class names are replaced according to the given Map object.

Parameters
newCp:ConstPool

the constant pool table used by the new copy.

classnames:Map<String, String>

pairs of replaced and substituted class names.

copyAllback to summary
pack-priv static List<AttributeInfo> copyAll(List<AttributeInfo> attributes, ConstPool cp)
getback to summary
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.

getConstPoolback to summary
public ConstPool getConstPool()

Returns a constant pool table.

getLengthback to summary
pack-priv static int getLength(List<AttributeInfo> attributes)
getNameback to summary
public String getName()

Returns an attribute name.

getRefClassesback to summary
pack-priv void getRefClasses(Map<String, String> classnames)
getRefClassesback to summary
pack-priv static void getRefClasses(List<AttributeInfo> attributes, Map<String, String> classnames)
lengthback to summary
public int length()

Returns the length of this attribute_info structure. The returned value is attribute_length + 6.

lookupback to summary
pack-priv static AttributeInfo lookup(List<AttributeInfo> attributes, String name)
readback to summary
pack-priv static AttributeInfo read(ConstPool cp, DataInputStream in) throws IOException
removeback to summary
pack-priv static synchronized AttributeInfo remove(List<AttributeInfo> attributes, String name)
renameClassback to summary
pack-priv void renameClass(String oldname, String newname)
renameClassback to summary
pack-priv void renameClass(Map<String, String> classnames)
renameClassback to summary
pack-priv static void renameClass(List<AttributeInfo> attributes, String oldname, String newname)
renameClassback to summary
pack-priv static void renameClass(List<AttributeInfo> attributes, Map<String, String> classnames)
setback to summary
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.

writeback to summary
pack-priv void write(DataOutputStream out) throws IOException
writeAllback to summary
pack-priv static void writeAll(List<AttributeInfo> attributes, DataOutputStream out) throws IOException