Package org.apache.bcel.classfile
Class RecordComponentInfo
- java.lang.Object
-
- org.apache.bcel.classfile.RecordComponentInfo
-
- All Implemented Interfaces:
Node
public class RecordComponentInfo extends java.lang.Object implements Node
Record component info from a record. Instances from this class maps every component from a given record.- Since:
- 6.9.0
- See Also:
- The Java Virtual Machine Specification, Java SE 14 Edition, Records (preview)
-
-
Constructor Summary
Constructors Constructor Description RecordComponentInfo(java.io.DataInput input, ConstantPool constantPool)Constructs a new instance from an input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor v)Accepts a visitor.voiddump(java.io.DataOutputStream file)Dumps contents into a file stream in binary format.<T extends Attribute>
TgetAttribute(byte tag)Gets the attribute for the given tag if present, or null if absent.Attribute[]getAttributes()Gets all attributes.ConstantPoolgetConstantPool()Gets the constant pool.intgetDescriptorIndex()Gets the description index.intgetIndex()Gets the name index.java.lang.StringtoString()Converts this instance to a String suitable for debugging.
-
-
-
Constructor Detail
-
RecordComponentInfo
public RecordComponentInfo(java.io.DataInput input, ConstantPool constantPool) throws java.io.IOException
Constructs a new instance from an input stream.- Parameters:
input- Input stream.constantPool- Array of constants.- Throws:
java.io.IOException- Thrown if an I/O error occurs.
-
-
Method Detail
-
dump
public void dump(java.io.DataOutputStream file) throws java.io.IOException
Dumps contents into a file stream in binary format.- Parameters:
file- Output file stream.- Throws:
java.io.IOException- Thrown if an I/O error occurs.
-
getAttribute
public final <T extends Attribute> T getAttribute(byte tag)
Gets the attribute for the given tag if present, or null if absent.- Type Parameters:
T- The attribute type.- Parameters:
tag- The attribute tag.- Returns:
- Attribute for given tag, null if not found.
Refer to
Const.ATTR_UNKNOWNconstants named ATTR_* for possible values. - Since:
- 6.13.0
-
getAttributes
public Attribute[] getAttributes()
Gets all attributes.- Returns:
- all attributes.
-
getConstantPool
public ConstantPool getConstantPool()
Gets the constant pool.- Returns:
- Constant pool.
-
getDescriptorIndex
public int getDescriptorIndex()
Gets the description index.- Returns:
- index in constant pool of this record component descriptor.
-
getIndex
public int getIndex()
Gets the name index.- Returns:
- index in constant pool of this record component name.
-
toString
public java.lang.String toString()
Converts this instance to a String suitable for debugging.- Overrides:
toStringin classjava.lang.Object- Returns:
- A String suitable for debugging.
-
-