Annotation Interface BotControllerAdvice


@Target(TYPE) @Retention(RUNTIME) @Documented @Component public @interface BotControllerAdvice
Marks a class as a global bot exception handler advice, applied across all BotController beans. Analogous to Spring Web's @ControllerAdvice.

Methods annotated with BotExceptionHandler inside an advice class act as global fallbacks. Controller-local exception handlers (inside BotController classes) always take priority over advice handlers for the same exception type.

Optionally restrict which BotController beans this advice applies to using basePackages(), assignableTypes(), or annotations(). Empty arrays (the default) mean the advice applies globally to all controllers.

Since:
0.0.2
Author:
Islom Mirsaburov
  • Element Details

    • value

      String value
      Alias for the Spring bean name of this advice component.
      Default:
      ""
    • basePackages

      String[] basePackages
      Restrict this advice to BotController beans in these base packages. Empty (default) means all packages.
      Default:
      {}
    • assignableTypes

      Class<?>[] assignableTypes
      Restrict this advice to BotController beans that are assignable to one of these types. Empty (default) means all types.
      Default:
      {}
    • annotations

      Class<? extends Annotation>[] annotations
      Restrict this advice to BotController beans annotated with one of these annotations. Empty (default) means all controllers.
      Default:
      {}