Class Implementation.Simple

    • Field Detail

      • NO_ADDITIONAL_VARIABLES

        private static final int NO_ADDITIONAL_VARIABLES
        Indicates that no additional local variable slots are required.
        See Also:
        Constant Field Values
      • byteCodeAppender

        private final ByteCodeAppender byteCodeAppender
        The byte code appender to emmit.
    • Constructor Detail

      • Simple

        public Simple​(ByteCodeAppender... byteCodeAppender)
        Creates a new simple implementation for the given byte code appenders.
        Parameters:
        byteCodeAppender - The byte code appenders to apply in their order of application.
      • Simple

        public Simple​(StackManipulation... stackManipulation)
        Creates a new simple instrumentation for the given stack manipulations which are summarized in a byte code appender that defines any requested method by these manipulations.
        Parameters:
        stackManipulation - The stack manipulation to apply in their order of application.
    • Method Detail

      • of

        public static Implementation of​(Implementation.Simple.Dispatcher dispatcher)
        Resolves a simple implementation that applies the given dispatcher without defining additional local variables.
        Parameters:
        dispatcher - The dispatcher to use.
        Returns:
        An implementation for the supplied dispatcher.
      • of

        public static Implementation of​(Implementation.Simple.Dispatcher dispatcher,
                                        int additionalVariableLength)
        Resolves a simple implementation that applies the given dispatcher.
        Parameters:
        dispatcher - The dispatcher to use.
        additionalVariableLength - The amount of additional slots required in the local variable array.
        Returns:
        An implementation for the supplied dispatcher.
      • of

        public static Implementation of​(Implementation.Simple.Dispatcher dispatcher,
                                        InstrumentedType.Prepareable prepareable)
        Resolves a simple implementation that applies the given dispatcher without defining additional local variables.
        Parameters:
        dispatcher - The dispatcher to use.
        prepareable - A preparation of the instrumented type.
        Returns:
        An implementation for the supplied dispatcher.
      • of

        public static Implementation of​(Implementation.Simple.Dispatcher dispatcher,
                                        InstrumentedType.Prepareable prepareable,
                                        int additionalVariableLength)
        Resolves a simple implementation that applies the given dispatcher.
        Parameters:
        dispatcher - The dispatcher to use.
        prepareable - A preparation of the instrumented type.
        additionalVariableLength - The amount of additional slots required in the local variable array.
        Returns:
        An implementation for the supplied dispatcher.
      • appender

        public ByteCodeAppender appender​(Implementation.Target implementationTarget)
        Creates a byte code appender that determines the implementation of the instrumented type's methods.
        Specified by:
        appender in interface Implementation
        Parameters:
        implementationTarget - The target of the current implementation.
        Returns:
        A byte code appender for implementing methods delegated to this implementation. This byte code appender is also responsible for handling methods that were added by this implementation on the call to InstrumentedType.Prepareable.prepare(InstrumentedType).