4379: allow interceptor annotation on methods (#4380)
* 4379: allow interceptor annotation on methods * 4379: document order parameter when annotation set on method * Credit for #4380 --------- Co-authored-by: James Agnew <jamesagnew@gmail.com>
This commit is contained in:
parent
d5184a8a57
commit
9ae71aba95
|
@ -30,7 +30,7 @@ import java.lang.annotation.Target;
|
|||
* is not mandatory for interceptor classes, but is added as a marker by convention.
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||
@Inherited
|
||||
public @interface Interceptor {
|
||||
|
||||
|
@ -41,7 +41,7 @@ public @interface Interceptor {
|
|||
|
||||
/**
|
||||
* The order that interceptors should be called in. Lower numbers happen before higher numbers. Default is 0
|
||||
* and allowable values can be positive or negative or 0.
|
||||
* and allowable values can be positive or negative or 0. Ignored when annotation is set on a method.
|
||||
*/
|
||||
int order() default DEFAULT_ORDER;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
type: add
|
||||
issue: 4380
|
||||
title: "The `@Interceptor` annotation can now be placed at the method level. This is used only
|
||||
as a marker, and does not change the behaviour or interceptors in any way. Thanks to
|
||||
Dominique Villard for the pull request!"
|
Loading…
Reference in New Issue