|
30 | 30 | *
|
31 | 31 | * <p>If an annotated method supports a single event type, the method may
|
32 | 32 | * declare a single parameter that reflects the event type to listen to.
|
33 |
| - * If an annotated method supports multiple event types, this annotation may |
34 |
| - * refer to one or more supported event types using the {@code classes} |
35 |
| - * attribute. See {@link #classes} for further details. |
| 33 | + * If an annotated method supports multiple event types, this annotation |
| 34 | + * may refer to one or more supported event types using the {@code classes} |
| 35 | + * attribute. See the {@link #classes} javadoc for further details. |
36 | 36 | *
|
37 | 37 | * <p>Events can be {@link ApplicationEvent} instances as well as arbitrary
|
38 | 38 | * objects.
|
39 | 39 | *
|
40 |
| - * <p>Processing of {@code @EventListener} annotations is performed via the |
41 |
| - * {@link EventListenerMethodProcessor} which is registered automatically |
42 |
| - * when using Java config or manually via the {@code <context:annotation-driven/>} |
| 40 | + * <p>Processing of {@code @EventListener} annotations is performed via |
| 41 | + * the internal {@link EventListenerMethodProcessor} bean which gets |
| 42 | + * registered automatically when using Java config or manually via the |
| 43 | + * {@code <context:annotation-config/>} or {@code <context:component-scan/>} |
43 | 44 | * element when using XML config.
|
44 | 45 | *
|
45 |
| - * <p>Annotated methods may have a non-{@code void} return type. When they do, |
46 |
| - * the result of the method invocation is sent as a new event. If the return type |
47 |
| - * is either an array or a collection, each element is sent as a new event. |
| 46 | + * <p>Annotated methods may have a non-{@code void} return type. When they |
| 47 | + * do, the result of the method invocation is sent as a new event. If the |
| 48 | + * return type is either an array or a collection, each element is sent |
| 49 | + * as a new individual event. |
48 | 50 | *
|
49 |
| - * <p>It is also possible to define the order in which listeners for a certain |
50 |
| - * event are invoked. To do so, add Spring's common |
| 51 | + * <p>It is also possible to define the order in which listeners for a |
| 52 | + * certain event are to be invoked. To do so, add Spring's common |
51 | 53 | * {@link org.springframework.core.annotation.Order @Order} annotation
|
52 |
| - * alongside this annotation. |
| 54 | + * alongside this event listener annotation. |
53 | 55 | *
|
54 |
| - * <p>While it is possible for an event listener to declare that it throws arbitrary |
55 |
| - * exception types, any checked exceptions thrown from an event listener will be |
56 |
| - * wrapped in an {@link java.lang.reflect.UndeclaredThrowableException} since |
57 |
| - * the caller can only handle runtime exceptions. |
| 56 | + * <p>While it is possible for an event listener to declare that it |
| 57 | + * throws arbitrary exception types, any checked exceptions thrown |
| 58 | + * from an event listener will be wrapped in an |
| 59 | + * {@link java.lang.reflect.UndeclaredThrowableException} |
| 60 | + * since the event publisher can only handle runtime exceptions. |
58 | 61 | *
|
59 | 62 | * @author Stephane Nicoll
|
60 | 63 | * @since 4.2
|
|
73 | 76 |
|
74 | 77 | /**
|
75 | 78 | * The event classes that this listener handles.
|
76 |
| - * <p>If this attribute is specified with a single value, the annotated |
77 |
| - * method may optionally accept a single parameter. However, if this |
78 |
| - * attribute is specified with multiple values, the annotated method |
79 |
| - * must <em>not</em> declare any parameters. |
| 79 | + * <p>If this attribute is specified with a single value, the |
| 80 | + * annotated method may optionally accept a single parameter. |
| 81 | + * However, if this attribute is specified with multiple values, |
| 82 | + * the annotated method must <em>not</em> declare any parameters. |
80 | 83 | */
|
81 | 84 | @AliasFor("value")
|
82 | 85 | Class<?>[] classes() default {};
|
83 | 86 |
|
84 | 87 | /**
|
85 |
| - * Spring Expression Language (SpEL) attribute used for making the event |
86 |
| - * handling conditional. |
| 88 | + * Spring Expression Language (SpEL) attribute used for making the |
| 89 | + * event handling conditional. |
87 | 90 | * <p>Default is "", meaning the event is always handled.
|
88 | 91 | */
|
89 | 92 | String condition() default "";
|
|
0 commit comments