Interface InterceptorCodeGenerator


public interface InterceptorCodeGenerator
Processor-path plugin extension point for direct interceptor code generation.
  • Method Details

    • supports

      boolean supports(@Nonnull InterceptorBindingModel binding)
      Return true if this generator claims the effective interceptor binding.
      Parameters:
      binding - the effective interceptor binding.
      Returns:
      true if this generator claims the effective interceptor binding.
    • emitBefore

      void emitBefore(@Nonnull InterceptedMethodModel method, @Nonnull InterceptorBindingModel binding, @Nonnull LifecycleCodeEmitter emitter)
      Emit code that runs before the target method invocation.
      Parameters:
      method - the intercepted method metadata.
      binding - the effective interceptor binding.
      emitter - the lifecycle code emitter.
    • emitAfter

      void emitAfter(@Nonnull InterceptedMethodModel method, @Nonnull InterceptorBindingModel binding, @Nonnull LifecycleCodeEmitter emitter)
      Emit code that runs after a successful target method invocation.
      Parameters:
      method - the intercepted method metadata.
      binding - the effective interceptor binding.
      emitter - the lifecycle code emitter.
    • emitAfterException

      void emitAfterException(@Nonnull InterceptedMethodModel method, @Nonnull InterceptorBindingModel binding, @Nonnull LifecycleCodeEmitter emitter)
      Emit code that runs when the target method invocation or an inner interceptor fails.
      Parameters:
      method - the intercepted method metadata.
      binding - the effective interceptor binding.
      emitter - the lifecycle code emitter.