Package net.bytebuddy.asm
Class MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation.OfSerializedConstant<T extends Annotation>
java.lang.Object
net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory.AbstractBase<T>
net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation.OfSerializedConstant<T>
- Type Parameters:
T
- The type of the annotation.
- All Implemented Interfaces:
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<T>
- Enclosing class:
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation
@Enhance
public static class MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.ForStackManipulation.OfSerializedConstant<T extends Annotation>
extends MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory.AbstractBase<T>
Assigns a value to the annotated parameter that is deserialized from a given input.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory.AbstractBase<S extends Annotation>, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory.Simple<S extends Annotation>, MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory.WithParameterSupportOnly<S extends Annotation>
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe annotation type.private final StackManipulation
A stack manipulation that represents the deserialization.private final TypeDescription.Generic
A description of the type that is returned as a result of the deserialization. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
OfSerializedConstant
(Class<T> annotationType, StackManipulation deserialization, TypeDescription.Generic typeDescription) Creates a factory that creates an offset mapping for a value that is deserialized. -
Method Summary
Modifier and TypeMethodDescriptionReturns the type of the annotation for this factory.make
(TypeDescription.Generic target, AnnotationDescription.Loadable<T> annotation) Returns an offset mapping for the bound method target or parameter.static <S extends Annotation,
U extends Serializable>
MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<S> Creates a factory for an offset mapping that deserializes a given value that is then assigned to the annotated parameter or used as a method target.Methods inherited from class net.bytebuddy.asm.MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory.AbstractBase
make, make
-
Field Details
-
annotationType
The annotation type. -
deserialization
A stack manipulation that represents the deserialization. -
typeDescription
A description of the type that is returned as a result of the deserialization.
-
-
Constructor Details
-
OfSerializedConstant
protected OfSerializedConstant(Class<T> annotationType, StackManipulation deserialization, TypeDescription.Generic typeDescription) Creates a factory that creates an offset mapping for a value that is deserialized.- Parameters:
annotationType
- The annotation type.deserialization
- A stack manipulation that represents the deserialization.typeDescription
- A description of the type that is returned as a result of the deserialization.
-
-
Method Details
-
of
public static <S extends Annotation,U extends Serializable> MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory<S> of(Class<S> type, U value, Class<? super U> targetType) Creates a factory for an offset mapping that deserializes a given value that is then assigned to the annotated parameter or used as a method target.- Type Parameters:
S
- The type of the annotation.U
- The type of the serialized value.- Parameters:
type
- The annotation type.value
- The serialized value.targetType
- The type of the value that is deserialized.- Returns:
- An appropriate factory for an offset mapping.
-
getAnnotationType
Returns the type of the annotation for this factory.- Returns:
- The type of the annotation for this factory.
-
make
protected MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping make(TypeDescription.Generic target, AnnotationDescription.Loadable<T> annotation) Description copied from class:MemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory.AbstractBase
Returns an offset mapping for the bound method target or parameter.- Specified by:
make
in classMemberSubstitution.Substitution.Chain.Step.ForDelegation.OffsetMapping.Factory.AbstractBase<T extends Annotation>
- Parameters:
target
- The declaring type of a non-static method or a parameter type.annotation
- The annotation that was found on the method or parameter.- Returns:
- An appropriate offset mapping.
-