Package net.bytebuddy.asm
Class Advice.OffsetMapping.ForSerializedValue.Factory<T extends Annotation>
- java.lang.Object
-
- net.bytebuddy.asm.Advice.OffsetMapping.ForSerializedValue.Factory<T>
-
- Type Parameters:
T
- The annotation type this factory binds.
- All Implemented Interfaces:
Advice.OffsetMapping.Factory<T>
- Enclosing class:
- Advice.OffsetMapping.ForSerializedValue
@Enhance public static class Advice.OffsetMapping.ForSerializedValue.Factory<T extends Annotation> extends Object implements Advice.OffsetMapping.Factory<T>
A factory for loading a deserialized value.
-
-
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>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Factory(Class<T> annotationType, TypeDescription typeDescription, StackManipulation deserialization)
Creates a factory for loading a deserialized value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<T>
getAnnotationType()
Returns the annotation type of this factory.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.static <S extends Annotation>
Advice.OffsetMapping.Factory<S>of(Class<S> annotationType, Serializable target, Class<?> targetType)
Creates a factory for an offset mapping that loads the provided value.
-
-
-
Constructor Detail
-
Factory
protected Factory(Class<T> annotationType, TypeDescription typeDescription, StackManipulation deserialization)
Creates a factory for loading a deserialized value.- Parameters:
annotationType
- The annotation type.typeDescription
- The type description as which to treat the deserialized value.deserialization
- The stack manipulation that loads the represented value.
-
-
Method Detail
-
of
public static <S extends Annotation> Advice.OffsetMapping.Factory<S> of(Class<S> annotationType, Serializable target, Class<?> targetType)
Creates a factory for an offset mapping that loads the provided value.- Type Parameters:
S
- The annotation type the created factory binds.- Parameters:
annotationType
- The annotation type to be bound.target
- The instance representing the value to be deserialized.targetType
- The target type as which to use the target value.- Returns:
- An appropriate offset mapping factory.
-
getAnnotationType
public Class<T> 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.
-
-