Class DynamicType.Builder.AbstractBase.Adapter.MethodDefinitionAdapter.AnnotationAdapter

    • Constructor Detail

      • AnnotationAdapter

        protected AnnotationAdapter​(MethodRegistry.Handler handler)
        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 Detail

      • receiverType

        public DynamicType.Builder.MethodDefinition<U> receiverType​(TypeDescription.Generic 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​(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

        public DynamicType.Builder.MethodDefinition<U> 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.