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

Type Parameters:
V - A loaded type that the built type is guaranteed to be a subclass of.
All Implemented Interfaces:
DynamicType.Builder<V>, DynamicType.Builder.MethodDefinition<V>, DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition<V>
Direct Known Subclasses:
DynamicType.Builder.AbstractBase.Adapter.MethodDefinitionAdapter.AnnotationAdapter, DynamicType.Builder.AbstractBase.Adapter.MethodMatchAdapter.AnnotationAdapter
Enclosing class:
DynamicType.Builder.MethodDefinition.AbstractBase<U>

@Enhance protected abstract static class DynamicType.Builder.MethodDefinition.AbstractBase.Adapter<V> extends DynamicType.Builder.MethodDefinition.ReceiverTypeDefinition.AbstractBase<V>
An adapter implementation of a method definition.
  • Field Details

    • 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 Details

    • 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 Details

    • 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

      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.