final class RecordComponentWriter extends RecordComponentVisitor
Modifier and Type | Field and Description |
---|---|
private int |
accessFlags
The access_flags field can only be
Opcodes.ACC_DEPRECATED . |
private int |
descriptorIndex
The descriptor_index field of the the Record attribute.
|
private Attribute |
firstAttribute
The first non standard attribute of this record component.
|
private AnnotationWriter |
lastRuntimeInvisibleAnnotation
The last runtime invisible annotation of this record component.
|
private AnnotationWriter |
lastRuntimeInvisibleTypeAnnotation
The last runtime invisible type annotation of this record component.
|
private AnnotationWriter |
lastRuntimeVisibleAnnotation
The last runtime visible annotation of this record component.
|
private AnnotationWriter |
lastRuntimeVisibleTypeAnnotation
The last runtime visible type annotation of this record component.
|
private int |
nameIndex
The name_index field of the Record attribute.
|
private int |
signatureIndex
The signature_index field of the Signature attribute of this record component, or 0 if there is
no Signature attribute.
|
private SymbolTable |
symbolTable
Where the constants used in this RecordComponentWriter must be stored.
|
api, delegate
Constructor and Description |
---|
RecordComponentWriter(SymbolTable symbolTable,
int accessFlags,
java.lang.String name,
java.lang.String descriptor,
java.lang.String signature)
Constructs a new
RecordComponentWriter . |
Modifier and Type | Method and Description |
---|---|
(package private) void |
collectAttributePrototypes(Attribute.Set attributePrototypes)
Collects the attributes of this record component into the given set of attribute prototypes.
|
(package private) int |
computeRecordComponentInfoSize()
Returns the size of the record component JVMS structure generated by this
RecordComponentWriter.
|
(package private) void |
putRecordComponentInfo(ByteVector output)
Puts the content of the record component generated by this RecordComponentWriter into the given
ByteVector.
|
AnnotationVisitor |
visitAnnotationExperimental(java.lang.String descriptor,
boolean visible)
Visits an annotation of the record component.
|
void |
visitAttributeExperimental(Attribute attribute)
Visits a non standard attribute of the record component.
|
void |
visitEndExperimental()
Visits the end of the record component.
|
AnnotationVisitor |
visitTypeAnnotationExperimental(int typeRef,
TypePath typePath,
java.lang.String descriptor,
boolean visible)
Visits an annotation on a type in the record component signature.
|
getDelegateExperimental
private final SymbolTable symbolTable
private final int accessFlags
Opcodes.ACC_DEPRECATED
.private final int nameIndex
private final int descriptorIndex
private int signatureIndex
private AnnotationWriter lastRuntimeVisibleAnnotation
AnnotationWriter.previousAnnotation
field. May be null.private AnnotationWriter lastRuntimeInvisibleAnnotation
AnnotationWriter.previousAnnotation
field. May be null.private AnnotationWriter lastRuntimeVisibleTypeAnnotation
AnnotationWriter.previousAnnotation
field. May be null.private AnnotationWriter lastRuntimeInvisibleTypeAnnotation
AnnotationWriter.previousAnnotation
field. May be null.private Attribute firstAttribute
Attribute.nextAttribute
field. May be null.
WARNING: this list stores the attributes in the reverse order of their visit.
firstAttribute is actually the last attribute visited in visitAttributeExperimental(Attribute)
. The putRecordComponentInfo(ByteVector)
method
writes the attributes in the order defined by this list, i.e. in the reverse order specified by
the user.
RecordComponentWriter(SymbolTable symbolTable, int accessFlags, java.lang.String name, java.lang.String descriptor, java.lang.String signature)
RecordComponentWriter
.symbolTable
- where the constants used in this RecordComponentWriter must be stored.accessFlags
- the record component access flags, only synthetic and/or deprecated.name
- the record component name.descriptor
- the record component descriptor (see Type
).signature
- the record component signature. May be null.public AnnotationVisitor visitAnnotationExperimental(java.lang.String descriptor, boolean visible)
RecordComponentVisitor
visitAnnotationExperimental
in class RecordComponentVisitor
descriptor
- the class descriptor of the annotation class.visible
- true if the annotation is visible at runtime.public AnnotationVisitor visitTypeAnnotationExperimental(int typeRef, TypePath typePath, java.lang.String descriptor, boolean visible)
RecordComponentVisitor
visitTypeAnnotationExperimental
in class RecordComponentVisitor
typeRef
- a reference to the annotated type. The sort of this type reference must be
TypeReference.CLASS_TYPE_PARAMETER
, TypeReference.CLASS_TYPE_PARAMETER_BOUND
or TypeReference.CLASS_EXTENDS
. See
TypeReference
.typePath
- the path to the annotated type argument, wildcard bound, array element type, or
static inner type within 'typeRef'. May be null if the annotation targets
'typeRef' as a whole.descriptor
- the class descriptor of the annotation class.visible
- true if the annotation is visible at runtime.public void visitAttributeExperimental(Attribute attribute)
RecordComponentVisitor
visitAttributeExperimental
in class RecordComponentVisitor
attribute
- an attribute.public void visitEndExperimental()
RecordComponentVisitor
visitEndExperimental
in class RecordComponentVisitor
int computeRecordComponentInfoSize()
void putRecordComponentInfo(ByteVector output)
output
- where the record_component_info structure must be put.final void collectAttributePrototypes(Attribute.Set attributePrototypes)
attributePrototypes
- a set of attribute prototypes.