Package net.bytebuddy.asm
Class Advice.OffsetMapping.ForField.Resolved.Factory<T extends java.lang.annotation.Annotation>
- java.lang.Object
-
- net.bytebuddy.asm.Advice.OffsetMapping.ForField.Resolved.Factory<T>
-
- Type Parameters:
T- The annotation type this factory binds.
- All Implemented Interfaces:
Advice.OffsetMapping.Factory<T>
- Enclosing class:
- Advice.OffsetMapping.ForField.Resolved
@Enhance public static class Advice.OffsetMapping.ForField.Resolved.Factory<T extends java.lang.annotation.Annotation> extends java.lang.Object implements Advice.OffsetMapping.Factory<T>
A factory that binds a field.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.asm.Advice.OffsetMapping.Factory
Advice.OffsetMapping.Factory.AdviceType, Advice.OffsetMapping.Factory.Illegal<T extends java.lang.annotation.Annotation>, Advice.OffsetMapping.Factory.Simple<T extends java.lang.annotation.Annotation>
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<T>annotationTypeThe annotation type.private FieldDescriptionfieldDescriptionThe field to be bound.private booleanreadOnlytrueif this factory should create a read-only binding.private Assigner.TypingtypingThe typing to use.
-
Constructor Summary
Constructors Constructor Description Factory(java.lang.Class<T> annotationType, FieldDescription fieldDescription)Creates a new factory for binding a specific field with read-only semantics and static typing.Factory(java.lang.Class<T> annotationType, FieldDescription fieldDescription, boolean readOnly, Assigner.Typing typing)Creates a new factory for binding a specific field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<T>getAnnotationType()Returns the annotation type of this factory.Advice.OffsetMappingmake(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<T> annotation, Advice.OffsetMapping.Factory.AdviceType adviceType)Creates a new offset mapping for the supplied parameter if possible.
-
-
-
Field Detail
-
annotationType
private final java.lang.Class<T extends java.lang.annotation.Annotation> annotationType
The annotation type.
-
fieldDescription
private final FieldDescription fieldDescription
The field to be bound.
-
readOnly
private final boolean readOnly
trueif this factory should create a read-only binding.
-
typing
private final Assigner.Typing typing
The typing to use.
-
-
Constructor Detail
-
Factory
public Factory(java.lang.Class<T> annotationType, FieldDescription fieldDescription)
Creates a new factory for binding a specific field with read-only semantics and static typing.- Parameters:
annotationType- The annotation type.fieldDescription- The field to bind.
-
Factory
public Factory(java.lang.Class<T> annotationType, FieldDescription fieldDescription, boolean readOnly, Assigner.Typing typing)
Creates a new factory for binding a specific field.- Parameters:
annotationType- The annotation type.fieldDescription- The field to bind.readOnly-trueif this factory should create a read-only binding.typing- The typing to use.
-
-
Method Detail
-
getAnnotationType
public java.lang.Class<T> getAnnotationType()
Returns the annotation type of this factory.- Specified by:
getAnnotationTypein interfaceAdvice.OffsetMapping.Factory<T extends java.lang.annotation.Annotation>- Returns:
- The factory's annotation type.
-
make
public Advice.OffsetMapping make(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<T> annotation, Advice.OffsetMapping.Factory.AdviceType adviceType)
Creates a new offset mapping for the supplied parameter if possible.- Specified by:
makein interfaceAdvice.OffsetMapping.Factory<T extends java.lang.annotation.Annotation>- Parameters:
target- The parameter description for which to resolve an offset mapping.annotation- The annotation that triggered this factory.adviceType-trueif the binding is applied using advice method delegation.- Returns:
- A resolved offset mapping or
nullif no mapping can be resolved for this parameter.
-
-