Class DynamicType.Builder.MethodDefinition.AbstractBase.Adapter<V>

    • Field Detail

      • handler

        protected final MethodRegistry.Handler handler
        The handler that determines how a method is implemented.
      • methodAttributeAppenderFactory

        protected final MethodAttributeAppender.Factory methodAttributeAppenderFactory
        The method attribute appender factory to apply onto the method that is currently being implemented.
      • transformer

        protected final Transformer<MethodDescription> transformer
        The transformer to apply onto the method that is currently being implemented.
    • Constructor Detail

      • Adapter

        protected Adapter​(MethodRegistry.Handler handler,
                          MethodAttributeAppender.Factory methodAttributeAppenderFactory,
                          Transformer<MethodDescription> transformer)
        Creates a new adapter for a method definition.
        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 transformer to apply onto the method that is currently being implemented.
    • Method Detail

      • attribute

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

        public DynamicType.Builder.MethodDefinition<V> 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.
      • materialize

        protected abstract DynamicType.Builder.MethodDefinition<V> materialize​(MethodRegistry.Handler handler,
                                                                               MethodAttributeAppender.Factory methodAttributeAppenderFactory,
                                                                               Transformer<MethodDescription> transformer)
        Materializes the current builder as a method definition.
        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.