Package net.bytebuddy.dynamic.scaffold
Class TypeWriter.FieldPool.Record.ForExplicitField
- java.lang.Object
-
- net.bytebuddy.dynamic.scaffold.TypeWriter.FieldPool.Record.ForExplicitField
-
- All Implemented Interfaces:
TypeWriter.FieldPool.Record
- Enclosing interface:
- TypeWriter.FieldPool.Record
public static class TypeWriter.FieldPool.Record.ForExplicitField extends java.lang.Object implements TypeWriter.FieldPool.Record
A record for a rich field with attributes and a potential default value.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.TypeWriter.FieldPool.Record
TypeWriter.FieldPool.Record.ForExplicitField, TypeWriter.FieldPool.Record.ForImplicitField
-
-
Constructor Summary
Constructors Constructor Description ForExplicitField(FieldAttributeAppender attributeAppender, java.lang.Object defaultValue, FieldDescription fieldDescription)Creates a record for a rich field.
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
ForExplicitField
public ForExplicitField(FieldAttributeAppender attributeAppender, java.lang.Object defaultValue, FieldDescription fieldDescription)
Creates a record for a rich field.- Parameters:
attributeAppender- The attribute appender for the field.defaultValue- The field's default value.fieldDescription- The implemented field.
-
-
Method Detail
-
isImplicit
public boolean isImplicit()
Description copied from interface:TypeWriter.FieldPool.RecordDetermines if this record is implicit, i.e is not defined by aTypeWriter.FieldPool.- Specified by:
isImplicitin interfaceTypeWriter.FieldPool.Record- Returns:
trueif this record is implicit.
-
getField
public FieldDescription getField()
Description copied from interface:TypeWriter.FieldPool.RecordReturns the field that this record represents.- Specified by:
getFieldin interfaceTypeWriter.FieldPool.Record- Returns:
- The field that this record represents.
-
getFieldAppender
public FieldAttributeAppender getFieldAppender()
Description copied from interface:TypeWriter.FieldPool.RecordReturns the field attribute appender for a given field.- Specified by:
getFieldAppenderin interfaceTypeWriter.FieldPool.Record- Returns:
- The attribute appender to be applied on the given field.
-
resolveDefault
public java.lang.Object resolveDefault(java.lang.Object defaultValue)
Description copied from interface:TypeWriter.FieldPool.RecordResolves the default value that this record represents. This is not possible for implicit records.- Specified by:
resolveDefaultin interfaceTypeWriter.FieldPool.Record- 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
public void apply(org.objectweb.asm.ClassVisitor classVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory)Description copied from interface:TypeWriter.FieldPool.RecordWrites this entry to a given class visitor.- Specified by:
applyin interfaceTypeWriter.FieldPool.Record- 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
public void apply(org.objectweb.asm.FieldVisitor fieldVisitor, AnnotationValueFilter.Factory annotationValueFilterFactory)Description copied from interface:TypeWriter.FieldPool.RecordApplies this record to a field visitor. This is not possible for implicit records.- Specified by:
applyin interfaceTypeWriter.FieldPool.Record- Parameters:
fieldVisitor- The field visitor onto which this record is to be applied.annotationValueFilterFactory- The annotation value filter factory to use for annotations.
-
-