Package net.bytebuddy.dynamic.scaffold
Class MethodRegistry.Handler.ForAnnotationValue
java.lang.Object
net.bytebuddy.dynamic.scaffold.MethodRegistry.Handler.ForAnnotationValue
- All Implemented Interfaces:
InstrumentedType.Prepareable
,MethodRegistry.Handler
,MethodRegistry.Handler.Compiled
- Enclosing interface:
MethodRegistry.Handler
@Enhance
public static class MethodRegistry.Handler.ForAnnotationValue
extends Object
implements MethodRegistry.Handler, MethodRegistry.Handler.Compiled
A handler for defining a default annotation value for a method.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
InstrumentedType.Prepareable.NoOp
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.MethodRegistry.Handler
MethodRegistry.Handler.Compiled, MethodRegistry.Handler.ForAbstractMethod, MethodRegistry.Handler.ForAnnotationValue, MethodRegistry.Handler.ForImplementation, MethodRegistry.Handler.ForVisibilityBridge
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AnnotationValue
<?, ?> The annotation value to set as a default value. -
Constructor Summary
ConstructorsConstructorDescriptionForAnnotationValue
(AnnotationValue<?, ?> annotationValue) Creates a handler for defining a default annotation value for a method. -
Method Summary
Modifier and TypeMethodDescriptionassemble
(MethodDescription methodDescription, MethodAttributeAppender attributeAppender, Visibility visibility) Assembles this compiled entry with a method attribute appender.compile
(Implementation.Target implementationTarget) Compiles this handler.prepare
(InstrumentedType instrumentedType) Prepares a given instrumented type.
-
Field Details
-
annotationValue
The annotation value to set as a default value.
-
-
Constructor Details
-
ForAnnotationValue
Creates a handler for defining a default annotation value for a method.- Parameters:
annotationValue
- The annotation value to set as a default value.
-
-
Method Details
-
prepare
Prepares a given instrumented type.- Specified by:
prepare
in interfaceInstrumentedType.Prepareable
- Parameters:
instrumentedType
- The instrumented type in its current form.- Returns:
- The prepared instrumented type.
-
compile
Compiles this handler.- Specified by:
compile
in interfaceMethodRegistry.Handler
- Parameters:
implementationTarget
- The implementation target to compile this handler for.- Returns:
- A compiled handler.
-
assemble
public TypeWriter.MethodPool.Record assemble(MethodDescription methodDescription, MethodAttributeAppender attributeAppender, Visibility visibility) Assembles this compiled entry with a method attribute appender.- Specified by:
assemble
in interfaceMethodRegistry.Handler.Compiled
- Parameters:
methodDescription
- The method description to apply with this handler.attributeAppender
- The method attribute appender to apply together with this handler.visibility
- The represented method's minimum visibility.- Returns:
- A method pool entry representing this handler and the given attribute appender.
-