Package javassist.bytecode
Class RecordAttribute
- java.lang.Object
-
- javassist.bytecode.AttributeInfo
-
- javassist.bytecode.RecordAttribute
-
public class RecordAttribute extends AttributeInfo
Represents the Record attribute in a class file, which stores information about the record components of a record class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRecordAttribute.RecordComponentInfoRepresents a single record component within the Record attribute.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Stringtag
-
Constructor Summary
Constructors Constructor Description RecordAttribute(ConstPool cp, int nameIndex, java.io.DataInputStream in)Constructs a RecordAttribute by reading from a DataInputStream.RecordAttribute(ConstPool cp, java.util.List<RecordAttribute.RecordComponentInfo> components)Constructs a RecordAttribute with specified components.
-
Method Summary
All 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.java.util.List<RecordAttribute.RecordComponentInfo>getComponents()Returns the list of record components.voidwrite(java.io.DataOutputStream out)-
Methods inherited from class javassist.bytecode.AttributeInfo
get, getConstPool, getName, length, set, setMaxAttributeLength
-
-
-
-
Field Detail
-
tag
public static final java.lang.String tag
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RecordAttribute
public RecordAttribute(ConstPool cp, int nameIndex, java.io.DataInputStream in) throws java.io.IOException
Constructs a RecordAttribute by reading from a DataInputStream.- Parameters:
cp- the constant poolnameIndex- the index into the constant pool of the attribute namein- the input stream to read from- Throws:
java.io.IOException- if an I/O error occurs
-
RecordAttribute
public RecordAttribute(ConstPool cp, java.util.List<RecordAttribute.RecordComponentInfo> components)
Constructs a RecordAttribute with specified components.- Parameters:
cp- the constant poolattrName- the attribute namecomponents- the list of record components
-
-
Method Detail
-
getComponents
public java.util.List<RecordAttribute.RecordComponentInfo> getComponents()
Returns the list of record components.- Returns:
- the list of RecordComponentInfo
-
copy
public AttributeInfo copy(ConstPool newCp, java.util.Map<java.lang.String,java.lang.String> classnames)
Description copied from class:AttributeInfoMakes a copy. Class names are replaced according to the givenMapobject.- Overrides:
copyin classAttributeInfo- Parameters:
newCp- the constant pool table used by the new copy.classnames- pairs of replaced and substituted class names.
-
write
public void write(java.io.DataOutputStream out) throws java.io.IOException- Throws:
java.io.IOException
-
-