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.RecordAn entry of a field pool that describes how a field is implemented.- See Also:
TypeWriter.FieldPool
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTypeWriter.FieldPool.Record.ForExplicitFieldA record for a rich field with attributes and a potential default value.static classTypeWriter.FieldPool.Record.ForImplicitFieldA record for a simple field without a default value where all of the field's declared annotations are appended.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapply(org.objectweb.asm.ClassVisitor classVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory)Writes this entry to a given class visitor.voidapply(org.objectweb.asm.FieldVisitor fieldVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory)Applies this record to a field visitor.FieldDescriptiongetField()Returns the field that this record represents.FieldAttributeAppendergetFieldAppender()Returns the field attribute appender for a given field.booleanisImplicit()Determines if this record is implicit, i.e is not defined by aTypeWriter.FieldPool.java.lang.ObjectresolveDefault(java.lang.Object defaultValue)Resolves the default value that this record represents.
-
-
-
Method Detail
-
isImplicit
boolean isImplicit()
Determines if this record is implicit, i.e is not defined by aTypeWriter.FieldPool.- Returns:
trueif 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
@MaybeNull java.lang.Object resolveDefault(@MaybeNull java.lang.Object defaultValue)
Resolves the default value that this record represents. This is not possible for implicit records.- Parameters:
defaultValue- The default value that was defined previously ornullif no default value is defined.- Returns:
- The default value for the represented field or
nullif 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.
-
-