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:
TypeWriter.FieldPool
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TypeWriter.FieldPool.Record.ForExplicitField
A record for a rich field with attributes and a potential default value.static class
TypeWriter.FieldPool.Record.ForImplicitField
A 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 void
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.FieldDescription
getField()
Returns the field that this record represents.FieldAttributeAppender
getFieldAppender()
Returns the field attribute appender for a given field.boolean
isImplicit()
Determines if this record is implicit, i.e is not defined by aTypeWriter.FieldPool
.java.lang.Object
resolveDefault(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:
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
java.lang.Object resolveDefault(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 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.
-
-