Package sting.processor
Interface InterceptorCodeGenerator
public interface InterceptorCodeGenerator
Processor-path plugin extension point for direct interceptor code generation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidemitAfter(InterceptedMethodModel method, InterceptorBindingModel binding, LifecycleCodeEmitter emitter) Emit code that runs after a successful target method invocation.voidemitAfterException(InterceptedMethodModel method, InterceptorBindingModel binding, LifecycleCodeEmitter emitter) Emit code that runs when the target method invocation or an inner interceptor fails.voidemitBefore(InterceptedMethodModel method, InterceptorBindingModel binding, LifecycleCodeEmitter emitter) Emit code that runs before the target method invocation.booleansupports(InterceptorBindingModel binding) Return true if this generator claims the effective interceptor binding.
-
Method Details
-
supports
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.
-