Package net.bytebuddy.dynamic.scaffold
Interface TypeWriter.FieldPool.Record
- All Known Implementing Classes:
TypeWriter.FieldPool.Record.ForExplicitField
,TypeWriter.FieldPool.Record.ForImplicitField
- Enclosing interface:
TypeWriter.FieldPool
public static interface TypeWriter.FieldPool.Record
An entry of a field pool that describes how a field is implemented.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
A record for a rich field with attributes and a potential default value.static class
A record for a simple field without a default value where all of the field's declared annotations are appended. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(org.objectweb.asm.ClassVisitor classVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory) Writes this entry to a given class visitor.void
apply
(org.objectweb.asm.FieldVisitor fieldVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory) Applies this record to a field visitor.getField()
Returns the field that this record represents.Returns the field attribute appender for a given field.boolean
Determines if this record is implicit, i.e is not defined by aTypeWriter.FieldPool
.resolveDefault
(Object defaultValue) Resolves the default value that this record represents.
-
Method Details
-
isImplicit
boolean isImplicit()Determines if this record is implicit, i.e is not defined by aTypeWriter.FieldPool
.- Returns:
true
if this record is implicit.
-
getField
FieldDescription getField()Returns the field that this record represents.- Returns:
- The field that this record represents.
-
getFieldAppender
FieldAttributeAppender getFieldAppender()Returns the field attribute appender for a given field.- Returns:
- The attribute appender to be applied on the given field.
-
resolveDefault
Resolves the default value that this record represents. This is not possible for implicit records.- Parameters:
defaultValue
- The default value that was defined previously ornull
if no default value is defined.- Returns:
- The default value for the represented field or
null
if no default value is to be defined.
-
apply
void apply(org.objectweb.asm.ClassVisitor classVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory) Writes this entry to a given class visitor.- Parameters:
classVisitor
- The class visitor to which this entry is to be written to.annotationValueFilterFactory
- The annotation value filter factory to apply when writing annotations.
-
apply
void apply(org.objectweb.asm.FieldVisitor fieldVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory) Applies this record to a field visitor. This is not possible for implicit records.- Parameters:
fieldVisitor
- The field visitor onto which this record is to be applied.annotationValueFilterFactory
- The annotation value filter factory to use for annotations.
-