Class DynamicType.Builder.AbstractBase.Adapter.MethodMatchAdapter.AnnotationAdapter
java.lang.Object
net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase<U>
net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase.Delegator<U>
net.bytebuddy.dynamic.DynamicType.Builder.MethodDefinition.AbstractBase<U>
net.bytebuddy.dynamic.DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition.AbstractBase<U>
net.bytebuddy.dynamic.DynamicType.Builder.MethodDefinition.AbstractBase.Adapter<U>
net.bytebuddy.dynamic.DynamicType.Builder.AbstractBase.Adapter.MethodMatchAdapter.AnnotationAdapter
- All Implemented Interfaces:
DynamicType.Builder<U>, DynamicType.Builder.MethodDefinition<U>, DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition<U>
- Enclosing class:
DynamicType.Builder.AbstractBase.Adapter.MethodMatchAdapter
@Enhance(includeSyntheticFields=true)
protected class DynamicType.Builder.AbstractBase.Adapter.MethodMatchAdapter.AnnotationAdapter
extends DynamicType.Builder.MethodDefinition.AbstractBase.Adapter<U>
An annotation adapter for implementing annotations during a method definition.
-
Nested Class Summary
Nested classes/interfaces inherited from class DynamicType.Builder.MethodDefinition.AbstractBase
DynamicType.Builder.MethodDefinition.AbstractBase.Adapter<V>Nested classes/interfaces inherited from class DynamicType.Builder.AbstractBase
DynamicType.Builder.AbstractBase.Delegator<U>, DynamicType.Builder.AbstractBase.UsingTypeWriter<U>Nested classes/interfaces inherited from interface DynamicType.Builder
DynamicType.Builder.AbstractBase<S>, DynamicType.Builder.FieldDefinition<S>, DynamicType.Builder.InnerTypeDefinition<S>, DynamicType.Builder.MethodDefinition<S>, DynamicType.Builder.ModuleDefinition<S>, DynamicType.Builder.RecordComponentDefinition<S>, DynamicType.Builder.TypeVariableDefinition<S>Nested classes/interfaces inherited from interface DynamicType.Builder.MethodDefinition
DynamicType.Builder.MethodDefinition.AbstractBase<U>, DynamicType.Builder.MethodDefinition.ExceptionDefinition<U>, DynamicType.Builder.MethodDefinition.ImplementationDefinition<U>, DynamicType.Builder.MethodDefinition.ParameterDefinition<U>, DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition<U>, DynamicType.Builder.MethodDefinition.TypeVariableDefinition<U>Nested classes/interfaces inherited from interface DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition
DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition.AbstractBase<V> -
Field Summary
Fields inherited from class DynamicType.Builder.MethodDefinition.AbstractBase.Adapter
handler, methodAttributeAppenderFactory, transformer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAnnotationAdapter(MethodRegistry.Handler handler) Creates a new annotation adapter.protectedAnnotationAdapter(MethodRegistry.Handler handler, MethodAttributeAppender.Factory methodAttributeAppenderFactory, Transformer<MethodDescription> transformer) Creates a new annotation adapter. -
Method Summary
Modifier and TypeMethodDescriptionannotateMethod(Collection<? extends AnnotationDescription> annotations) Annotates the previously defined or matched method with the supplied annotations.annotateParameter(int index, Collection<? extends AnnotationDescription> annotations) Annotates the parameter of the given index of the previously defined or matched method with the supplied annotations.protected DynamicType.Builder<U> Creates a new builder that realizes the current state of the builder.protected DynamicType.Builder.MethodDefinition<U> materialize(MethodRegistry.Handler handler, MethodAttributeAppender.Factory methodAttributeAppenderFactory, Transformer<MethodDescription> transformer) Materializes the current builder as a method definition.receiverType(TypeDescription.Generic receiverType) Defines the supplied (annotated) receiver type for the previously defined or matched method.Methods inherited from class DynamicType.Builder.MethodDefinition.AbstractBase.Adapter
attribute, transformMethods inherited from class DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition.AbstractBase
receiverTypeMethods inherited from class DynamicType.Builder.MethodDefinition.AbstractBase
annotateMethod, annotateMethod, annotateMethod, annotateParameter, annotateParameter, annotateParameterMethods inherited from class DynamicType.Builder.AbstractBase.Delegator
adjustModule, adjustModule, annotateType, attribute, declaredTypes, define, defineConstructor, defineField, defineMethod, defineRecordComponent, field, ignoreAlso, ignoreAlso, implement, initializer, initializer, innerTypeOf, innerTypeOf, invokable, make, make, make, make, merge, modifiers, module, name, nestHost, nestMembers, permittedSubclass, recordComponent, recordComponent, require, suffix, topLevelType, toTypeDescription, transform, typeVariable, unsealed, visit, wrap, wrapMethods inherited from class DynamicType.Builder.AbstractBase
annotateType, annotateType, annotateType, constructor, declaredTypes, declaredTypes, declaredTypes, define, define, define, define, define, defineConstructor, defineConstructor, defineField, defineField, defineField, defineField, defineField, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineProperty, defineProperty, defineProperty, defineProperty, defineRecordComponent, field, implement, implement, implement, innerTypeOf, innerTypeOf, innerTypeOf, invokable, merge, method, modifiers, modifiers, module, module, nestHost, nestMembers, nestMembers, nestMembers, noNestMate, permittedSubclass, permittedSubclass, permittedSubclass, require, require, require, serialVersionUid, typeVariable, typeVariable, typeVariable, typeVariable, withHashCodeEquals, withToString, wrap, wrapMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DynamicType.Builder
adjustModule, adjustModule, annotateType, annotateType, annotateType, annotateType, attribute, constructor, declaredTypes, declaredTypes, declaredTypes, declaredTypes, define, define, define, define, define, define, defineConstructor, defineConstructor, defineConstructor, defineField, defineField, defineField, defineField, defineField, defineField, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineMethod, defineProperty, defineProperty, defineProperty, defineProperty, defineRecordComponent, defineRecordComponent, field, field, ignoreAlso, ignoreAlso, implement, implement, implement, implement, initializer, initializer, innerTypeOf, innerTypeOf, innerTypeOf, innerTypeOf, innerTypeOf, invokable, invokable, make, make, make, make, merge, merge, method, modifiers, modifiers, modifiers, module, module, module, name, nestHost, nestHost, nestMembers, nestMembers, nestMembers, nestMembers, noNestMate, permittedSubclass, permittedSubclass, permittedSubclass, permittedSubclass, recordComponent, recordComponent, require, require, require, require, serialVersionUid, suffix, topLevelType, toTypeDescription, transform, typeVariable, typeVariable, typeVariable, typeVariable, typeVariable, unsealed, visit, withHashCodeEquals, withToString, wrap, wrap, wrap, wrapMethods inherited from interface DynamicType.Builder.MethodDefinition
annotateMethod, annotateMethod, annotateMethod, annotateParameter, annotateParameter, annotateParameter
-
Constructor Details
-
AnnotationAdapter
Creates a new annotation adapter.- Parameters:
handler- The handler that determines how a method is implemented.
-
AnnotationAdapter
protected AnnotationAdapter(MethodRegistry.Handler handler, MethodAttributeAppender.Factory methodAttributeAppenderFactory, Transformer<MethodDescription> transformer) Creates a new annotation adapter.- Parameters:
handler- The handler that determines how a method is implemented.methodAttributeAppenderFactory- The method attribute appender factory to apply onto the method that is currently being implemented.transformer- The method transformer to apply onto the method that is currently being implemented.
-
-
Method Details
-
receiverType
Defines the supplied (annotated) receiver type for the previously defined or matched method.- Parameters:
receiverType- The receiver type to define on the previously defined or matched method.- Returns:
- A new builder that is equal to this builder but with the given type defined as the receiver on the previously defined or matched method.
-
annotateMethod
public DynamicType.Builder.MethodDefinition<U> annotateMethod(Collection<? extends AnnotationDescription> annotations) Annotates the previously defined or matched method with the supplied annotations.- Parameters:
annotations- The annotations to declare on the previously defined or matched method.- Returns:
- A new builder that is equal to this builder but with the given annotations declared on the previously defined or matched method.
-
annotateParameter
public DynamicType.Builder.MethodDefinition<U> annotateParameter(int index, Collection<? extends AnnotationDescription> annotations) Annotates the parameter of the given index of the previously defined or matched method with the supplied annotations.- Parameters:
index- The parameter's index.annotations- The annotations to declare on the previously defined or matched method.- Returns:
- A new builder that is equal to this builder but with the given annotations declared on the previously defined or matched method's parameter of the given index.
-
materialize
protected DynamicType.Builder.MethodDefinition<U> materialize(MethodRegistry.Handler handler, MethodAttributeAppender.Factory methodAttributeAppenderFactory, Transformer<MethodDescription> transformer) Description copied from class:DynamicType.Builder.MethodDefinition.AbstractBase.AdapterMaterializes the current builder as a method definition.- Specified by:
materializein classDynamicType.Builder.MethodDefinition.AbstractBase.Adapter<U>- Parameters:
handler- The handler that determines how a method is implemented.methodAttributeAppenderFactory- The method attribute appender factory to apply onto the method that is currently being implemented.transformer- The method transformer to apply onto the method that is currently being implemented.- Returns:
- Returns a method definition for the supplied properties.
-
materialize
Description copied from class:DynamicType.Builder.AbstractBase.DelegatorCreates a new builder that realizes the current state of the builder.- Specified by:
materializein classDynamicType.Builder.AbstractBase.Delegator<U>- Returns:
- A new builder that realizes the current state of the builder.
-