Package net.bytebuddy.dynamic
Interface DynamicType.Builder.MethodDefinition<S>
-
- Type Parameters:
S
- A loaded type that the built type is guaranteed to be a subclass of.
- All Superinterfaces:
DynamicType.Builder<S>
- All Known Subinterfaces:
DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition<U>
- All Known Implementing Classes:
DynamicType.Builder.AbstractBase.Adapter.MethodDefinitionAdapter.AnnotationAdapter
,DynamicType.Builder.AbstractBase.Adapter.MethodMatchAdapter.AnnotationAdapter
,DynamicType.Builder.MethodDefinition.AbstractBase
,DynamicType.Builder.MethodDefinition.AbstractBase.Adapter
,DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition.AbstractBase
- Enclosing interface:
- DynamicType.Builder<T>
public static interface DynamicType.Builder.MethodDefinition<S> extends DynamicType.Builder<S>
A builder for a method definition.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
DynamicType.Builder.MethodDefinition.AbstractBase<U>
An abstract base implementation of a method definition.static interface
DynamicType.Builder.MethodDefinition.ExceptionDefinition<U>
A builder for defining an implementation of a method and optionally defining a type variable or thrown exception.static interface
DynamicType.Builder.MethodDefinition.ImplementationDefinition<U>
A builder for defining an implementation of a method.static interface
DynamicType.Builder.MethodDefinition.ParameterDefinition<U>
A builder for defining an implementation of a method and optionally defining a type variable, thrown exception or method parameter.static interface
DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition<U>
A builder for a method definition with a receiver type.static interface
DynamicType.Builder.MethodDefinition.TypeVariableDefinition<U>
A builder for defining an implementation of a method and optionally defining a type variable.-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.DynamicType.Builder
DynamicType.Builder.FieldDefinition<S>, DynamicType.Builder.InnerTypeDefinition<S>, DynamicType.Builder.MethodDefinition<S>, DynamicType.Builder.RecordComponentDefinition<S>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DynamicType.Builder.MethodDefinition<S>
annotateMethod(java.lang.annotation.Annotation... annotation)
Annotates the previously defined or matched method with the supplied annotations.DynamicType.Builder.MethodDefinition<S>
annotateMethod(java.util.Collection<? extends AnnotationDescription> annotations)
Annotates the previously defined or matched method with the supplied annotations.DynamicType.Builder.MethodDefinition<S>
annotateMethod(java.util.List<? extends java.lang.annotation.Annotation> annotations)
Annotates the previously defined or matched method with the supplied annotations.DynamicType.Builder.MethodDefinition<S>
annotateMethod(AnnotationDescription... annotation)
Annotates the previously defined or matched method with the supplied annotations.DynamicType.Builder.MethodDefinition<S>
annotateParameter(int index, java.lang.annotation.Annotation... annotation)
Annotates the parameter of the given index of the previously defined or matched method with the supplied annotations.DynamicType.Builder.MethodDefinition<S>
annotateParameter(int index, java.util.Collection<? extends AnnotationDescription> annotations)
Annotates the parameter of the given index of the previously defined or matched method with the supplied annotations.DynamicType.Builder.MethodDefinition<S>
annotateParameter(int index, java.util.List<? extends java.lang.annotation.Annotation> annotations)
Annotates the parameter of the given index of the previously defined or matched method with the supplied annotations.DynamicType.Builder.MethodDefinition<S>
annotateParameter(int index, AnnotationDescription... annotation)
Annotates the parameter of the given index of the previously defined or matched method with the supplied annotations.DynamicType.Builder.MethodDefinition<S>
attribute(MethodAttributeAppender.Factory methodAttributeAppenderFactory)
Applies the supplied method attribute appender factory onto the previously defined or matched method.DynamicType.Builder.MethodDefinition<S>
transform(Transformer<MethodDescription> transformer)
Applies the supplied transformer onto the previously defined or matched method.-
Methods inherited from interface net.bytebuddy.dynamic.DynamicType.Builder
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, 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
-
-
-
-
Method Detail
-
annotateMethod
DynamicType.Builder.MethodDefinition<S> annotateMethod(java.lang.annotation.Annotation... annotation)
Annotates the previously defined or matched method with the supplied annotations.- Parameters:
annotation
- 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.
-
annotateMethod
DynamicType.Builder.MethodDefinition<S> annotateMethod(java.util.List<? extends java.lang.annotation.Annotation> 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.
-
annotateMethod
DynamicType.Builder.MethodDefinition<S> annotateMethod(AnnotationDescription... annotation)
Annotates the previously defined or matched method with the supplied annotations.- Parameters:
annotation
- 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.
-
annotateMethod
DynamicType.Builder.MethodDefinition<S> annotateMethod(java.util.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
DynamicType.Builder.MethodDefinition<S> annotateParameter(int index, java.lang.annotation.Annotation... annotation)
Annotates the parameter of the given index of the previously defined or matched method with the supplied annotations.- Parameters:
index
- The parameter's index.annotation
- 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.
-
annotateParameter
DynamicType.Builder.MethodDefinition<S> annotateParameter(int index, java.util.List<? extends java.lang.annotation.Annotation> 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.
-
annotateParameter
DynamicType.Builder.MethodDefinition<S> annotateParameter(int index, AnnotationDescription... annotation)
Annotates the parameter of the given index of the previously defined or matched method with the supplied annotations.- Parameters:
index
- The parameter's index.annotation
- 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.
-
annotateParameter
DynamicType.Builder.MethodDefinition<S> annotateParameter(int index, java.util.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.
-
attribute
DynamicType.Builder.MethodDefinition<S> attribute(MethodAttributeAppender.Factory methodAttributeAppenderFactory)
Applies the supplied method attribute appender factory onto the previously defined or matched method.- Parameters:
methodAttributeAppenderFactory
- The method attribute appender factory that should be applied on the previously defined or matched method.- Returns:
- A new builder that is equal to this builder but with the supplied method attribute appender factory applied to the previously defined or matched method.
-
transform
DynamicType.Builder.MethodDefinition<S> transform(Transformer<MethodDescription> transformer)
Applies the supplied transformer onto the previously defined or matched method. The transformed method is written as it is and it not subject to any validations.- Parameters:
transformer
- The transformer to apply to the previously defined or matched method.- Returns:
- A new builder that is equal to this builder but with the supplied transformer applied to the previously defined or matched method.
-
-