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
attribute_info
structure.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AttributeInfo
(ConstPool cp, int attrname, byte[] attrinfo) protected
AttributeInfo
(ConstPool cp, int n, DataInputStream in) protected
AttributeInfo
(ConstPool cp, String attrname) AttributeInfo
(ConstPool cp, String attrname, byte[] attrinfo) Constructs anattribute_info
structure. -
Method Summary
Modifier and TypeMethodDescriptionMakes a copy.(package private) static List
<AttributeInfo> copyAll
(List<AttributeInfo> attributes, ConstPool cp) byte[]
get()
Returns theinfo
field of thisattribute_info
structure.Returns a constant pool table.(package private) static int
getLength
(List<AttributeInfo> attributes) getName()
Returns an attribute name.(package private) static void
getRefClasses
(List<AttributeInfo> attributes, Map<String, String> classnames) (package private) void
getRefClasses
(Map<String, String> classnames) int
length()
Returns the length of thisattribute_info
structure.(package private) static AttributeInfo
lookup
(List<AttributeInfo> attributes, String name) (package private) static AttributeInfo
read
(ConstPool cp, DataInputStream in) (package private) static AttributeInfo
remove
(List<AttributeInfo> attributes, String name) (package private) void
renameClass
(String oldname, String newname) (package private) static void
renameClass
(List<AttributeInfo> attributes, String oldname, String newname) (package private) static void
renameClass
(List<AttributeInfo> attributes, Map<String, String> classnames) (package private) void
renameClass
(Map<String, String> classnames) void
set
(byte[] newinfo) Sets theinfo
field of thisattribute_info
structure.(package private) void
write
(DataOutputStream out) (package private) static void
writeAll
(List<AttributeInfo> attributes, DataOutputStream out)
-
Field Details
-
constPool
-
name
int name -
info
byte[] info
-
-
Constructor Details
-
AttributeInfo
-
AttributeInfo
-
AttributeInfo
Constructs anattribute_info
structure.- Parameters:
cp
- constant pool tableattrname
- attribute nameattrinfo
-info
field ofattribute_info
structure.
-
AttributeInfo
- Throws:
IOException
-
-
Method Details
-
read
- Throws:
IOException
-
getName
Returns an attribute name. -
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
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.
-
write
- Throws:
IOException
-
getLength
-
lookup
-
remove
-
writeAll
- Throws:
IOException
-
copyAll
-
renameClass
-
renameClass
-
renameClass
-
renameClass
-
getRefClasses
-
getRefClasses
-