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 Object
attribute_info
structure.
-
-
Constructor Summary
Constructors Constructor Description AttributeInfo(ConstPool cp, String attrname, byte[] attrinfo)
Constructs anattribute_info
structure.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttributeInfo
copy(ConstPool newCp, Map<String,String> classnames)
Makes a copy.byte[]
get()
Returns theinfo
field of thisattribute_info
structure.ConstPool
getConstPool()
Returns a constant pool table.String
getName()
Returns an attribute name.int
length()
Returns the length of thisattribute_info
structure.void
set(byte[] newinfo)
Sets theinfo
field of thisattribute_info
structure.
-
-
-
Method Detail
-
getName
public String getName()
Returns an attribute name.
-
getConstPool
public ConstPool getConstPool()
Returns a constant pool table.
-
length
public int length()
Returns the length of thisattribute_info
structure. The returned value isattribute_length + 6
.
-
get
public byte[] get()
Returns theinfo
field of thisattribute_info
structure.This method is not available if the object is an instance of
CodeAttribute
.
-
set
public void set(byte[] newinfo)
Sets theinfo
field of thisattribute_info
structure.This method is not available if the object is an instance of
CodeAttribute
.
-
copy
public AttributeInfo copy(ConstPool newCp, Map<String,String> classnames)
Makes a copy. Class names are replaced according to the givenMap
object.- Parameters:
newCp
- the constant pool table used by the new copy.classnames
- pairs of replaced and substituted class names.
-
-