Package javassist.bytecode
Class AttributeInfo
- java.lang.Object
-
- javassist.bytecode.AttributeInfo
-
- Direct Known Subclasses:
AnnotationDefaultAttribute,AnnotationsAttribute,BootstrapMethodsAttribute,CodeAttribute,ConstantAttribute,DeprecatedAttribute,EnclosingMethodAttribute,ExceptionsAttribute,InnerClassesAttribute,LineNumberAttribute,LocalVariableAttribute,MethodParametersAttribute,NestHostAttribute,NestMembersAttribute,ParameterAnnotationsAttribute,SignatureAttribute,SourceFileAttribute,StackMap,StackMapTable,SyntheticAttribute,TypeAnnotationsAttribute
public class AttributeInfo extends java.lang.Objectattribute_infostructure.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAttributeInfo(ConstPool cp, int attrname, byte[] attrinfo)protectedAttributeInfo(ConstPool cp, int n, java.io.DataInputStream in)protectedAttributeInfo(ConstPool cp, java.lang.String attrname)AttributeInfo(ConstPool cp, java.lang.String attrname, byte[] attrinfo)Constructs anattribute_infostructure.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeInfocopy(ConstPool newCp, java.util.Map<java.lang.String,java.lang.String> classnames)Makes a copy.(package private) static java.util.List<AttributeInfo>copyAll(java.util.List<AttributeInfo> attributes, ConstPool cp)byte[]get()Returns theinfofield of thisattribute_infostructure.ConstPoolgetConstPool()Returns a constant pool table.(package private) static intgetLength(java.util.List<AttributeInfo> attributes)java.lang.StringgetName()Returns an attribute name.(package private) static voidgetRefClasses(java.util.List<AttributeInfo> attributes, java.util.Map<java.lang.String,java.lang.String> classnames)(package private) voidgetRefClasses(java.util.Map<java.lang.String,java.lang.String> classnames)intlength()Returns the length of thisattribute_infostructure.(package private) static AttributeInfolookup(java.util.List<AttributeInfo> attributes, java.lang.String name)(package private) static AttributeInforead(ConstPool cp, java.io.DataInputStream in)(package private) static AttributeInforemove(java.util.List<AttributeInfo> attributes, java.lang.String name)(package private) voidrenameClass(java.lang.String oldname, java.lang.String newname)(package private) static voidrenameClass(java.util.List<AttributeInfo> attributes, java.lang.String oldname, java.lang.String newname)(package private) static voidrenameClass(java.util.List<AttributeInfo> attributes, java.util.Map<java.lang.String,java.lang.String> classnames)(package private) voidrenameClass(java.util.Map<java.lang.String,java.lang.String> classnames)voidset(byte[] newinfo)Sets theinfofield of thisattribute_infostructure.(package private) voidwrite(java.io.DataOutputStream out)(package private) static voidwriteAll(java.util.List<AttributeInfo> attributes, java.io.DataOutputStream out)
-
-
-
Field Detail
-
constPool
protected ConstPool constPool
-
name
int name
-
info
byte[] info
-
-
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 anattribute_infostructure.- Parameters:
cp- constant pool tableattrname- attribute nameattrinfo-infofield ofattribute_infostructure.
-
AttributeInfo
protected AttributeInfo(ConstPool cp, int n, java.io.DataInputStream in) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
read
static AttributeInfo read(ConstPool cp, java.io.DataInputStream in) throws java.io.IOException
- Throws:
java.io.IOException
-
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 thisattribute_infostructure. The returned value isattribute_length + 6.
-
get
public byte[] get()
Returns theinfofield of thisattribute_infostructure.This method is not available if the object is an instance of
CodeAttribute.
-
set
public void set(byte[] newinfo)
Sets theinfofield of thisattribute_infostructure.This method is not available if the object is an instance of
CodeAttribute.
-
copy
public AttributeInfo copy(ConstPool newCp, java.util.Map<java.lang.String,java.lang.String> classnames)
Makes a copy. Class names are replaced according to the givenMapobject.- Parameters:
newCp- the constant pool table used by the new copy.classnames- pairs of replaced and substituted class names.
-
write
void write(java.io.DataOutputStream out) throws java.io.IOException- Throws:
java.io.IOException
-
getLength
static int getLength(java.util.List<AttributeInfo> attributes)
-
lookup
static AttributeInfo lookup(java.util.List<AttributeInfo> attributes, java.lang.String name)
-
remove
static AttributeInfo remove(java.util.List<AttributeInfo> attributes, java.lang.String name)
-
writeAll
static void writeAll(java.util.List<AttributeInfo> attributes, java.io.DataOutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
copyAll
static java.util.List<AttributeInfo> copyAll(java.util.List<AttributeInfo> attributes, ConstPool cp)
-
renameClass
void renameClass(java.lang.String oldname, java.lang.String newname)
-
renameClass
void renameClass(java.util.Map<java.lang.String,java.lang.String> classnames)
-
renameClass
static void renameClass(java.util.List<AttributeInfo> attributes, java.lang.String oldname, java.lang.String newname)
-
renameClass
static void renameClass(java.util.List<AttributeInfo> attributes, java.util.Map<java.lang.String,java.lang.String> classnames)
-
getRefClasses
void getRefClasses(java.util.Map<java.lang.String,java.lang.String> classnames)
-
getRefClasses
static void getRefClasses(java.util.List<AttributeInfo> attributes, java.util.Map<java.lang.String,java.lang.String> classnames)
-
-