Annotation Type InterceptorBinding


@Target(ANNOTATION_TYPE)
@Retention(RUNTIME)
@Documented
public @interface InterceptorBinding
Specifies that an annotation type is an interceptor binding type.
 @Inherited
 @InterceptorBinding
 @Target({ TYPE, METHOD, CONSTRUCTOR })
 @Retention(RUNTIME)
 public @interface Valid {
 }
 

Interceptor bindings are intermediate annotations that may be used to associate interceptors with target beans.

The interceptor bindings of an interceptor are specified by annotating the interceptor class with the binding types and the Interceptor annotation.

 @Valid @Interceptor
 public class ValidationInterceptor { ... }
 

An interceptor may specify multiple interceptor bindings.

An interceptor binding of a bean may be declared by annotating the bean class, a method of the bean class, or a constructor of the bean class with the interceptor binding type.

 @Valid
 public class Order { ... }
 
 @Valid @Secure
 public void updateOrder(Order order) { ... }
 
 @Valid
 public Order(...) { ... }
 

A bean class or method of a bean class may declare multiple interceptor bindings.

An interceptor binding type may declare other interceptor bindings.

 @Inherited
 @InterceptorBinding
 @Target({ TYPE, METHOD })
 @Retention(RUNTIME)
 @Valid
 public @interface Secure {
 }
 

Interceptor bindings are transitive—an interceptor binding declared by an interceptor binding type is inherited by all beans and other interceptor binding types that declare that interceptor binding type.

Since:
Jakarta Interceptors 1.1
See Also:
Interceptor