Package net.bytebuddy.asm
Class Advice.OffsetMapping.ForField.Resolved.Factory<T extends 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 Annotation>
extends 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 Annotation>, Advice.OffsetMapping.Factory.Simple<T extends Annotation>
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe annotation type.private final FieldDescription
The field to be bound.private final boolean
true
if this factory should create a read-only binding.private final Assigner.Typing
The typing to use. -
Constructor Summary
ConstructorsConstructorDescriptionFactory
(Class<T> annotationType, FieldDescription fieldDescription) Creates a new factory for binding a specific field with read-only semantics and static typing.Factory
(Class<T> annotationType, FieldDescription fieldDescription, boolean readOnly, Assigner.Typing typing) Creates a new factory for binding a specific field. -
Method Summary
Modifier and TypeMethodDescriptionReturns the annotation type of this factory.make
(ParameterDescription.InDefinedShape target, AnnotationDescription.Loadable<T> annotation, Advice.OffsetMapping.Factory.AdviceType adviceType) Creates a new offset mapping for the supplied parameter if possible.
-
Field Details
-
annotationType
The annotation type. -
fieldDescription
The field to be bound. -
readOnly
private final boolean readOnlytrue
if this factory should create a read-only binding. -
typing
The typing to use.
-
-
Constructor Details
-
Factory
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(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
-true
if this factory should create a read-only binding.typing
- The typing to use.
-
-
Method Details
-
getAnnotationType
Returns the annotation type of this factory.- Specified by:
getAnnotationType
in interfaceAdvice.OffsetMapping.Factory<T extends 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:
make
in interfaceAdvice.OffsetMapping.Factory<T extends Annotation>
- Parameters:
target
- The parameter description for which to resolve an offset mapping.annotation
- The annotation that triggered this factory.adviceType
-true
if the binding is applied using advice method delegation.- Returns:
- A resolved offset mapping or
null
if no mapping can be resolved for this parameter.
-