/*
 * Copyright 2002-2015 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.context.event;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.context.ApplicationEvent;
import org.springframework.core.annotation.AliasFor;

/**
 * Annotation that marks a method to listen for application events. The
 * method may have one (and only one) parameter that reflects the event
 * type to listen to. Or this annotation may refer to the event type(s)
 * using the {@link #classes} attribute. Events can be {@link ApplicationEvent}
 * instances as well as arbitrary objects.
 *
 * <p>Processing of {@code @EventListener} annotations is performed via
 * {@link EventListenerMethodProcessor} that is registered automatically
 * when using Java config or via the {@code <context:annotation-driven/>}
 * XML element.
 *
 * <p>Annotated methods may have a non-{@code void} return type. When they
 * do, the result of the method invocation is sent as a new event. It is
 * also possible to defined the order in which listeners for a certain
 * event are invoked. To do so, add a regular {code @Order} annotation
 * alongside this annotation.
 *
 * <p>While it is possible to define any arbitrary exception types, checked
 * exceptions will be wrapped in a {@link java.lang.reflect.UndeclaredThrowableException}
 * as the caller only handles runtime exceptions.
 *
 * @author Stephane Nicoll
 * @since 4.2
 * @see EventListenerMethodProcessor
 */
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface EventListener {

	/**
	 * Alias for {@link #classes}.
	 */
	@AliasFor(attribute = "classes")
	Class<?>[] value() default {};

	/**
	 * The event classes that this listener handles.
	 * <p>When this attribute is specified with one value, the method parameter
	 * may or may not be specified. When this attribute is specified with more
	 * than one value, the method must not have a parameter.
	 */
	@AliasFor(attribute = "value")
	Class<?>[] classes() default {};

	/**
	 * Spring Expression Language (SpEL) attribute used for making the event
	 * handling conditional.
	 * <p>Default is "", meaning the event is always handled.
	 */
	String condition() default "";

}
@@ -1006,25 +1006,29 @@
  method 
-to
+as a
  listen
+er
  for app
@@ -1047,30 +1047,40 @@
 nts.
- The%0A * method may hav
+%0A *%0A * %3Cp%3EThe method must declar
 e on
@@ -1127,17 +1127,17 @@
  the
+%0A *
  event
-%0A *
  typ
@@ -1152,18 +1152,30 @@
 ten to. 
-Or
+Alternatively,
  this an
@@ -1195,24 +1195,27 @@
 refer to the
+%0A *
  event type(
@@ -1216,19 +1216,16 @@
  type(s)
-%0A *
  using t
@@ -1268,16 +1268,19 @@
 s can be
+%0A *
  %7B@link 
@@ -1296,19 +1296,16 @@
 onEvent%7D
-%0A *
  instanc
@@ -1411,16 +1411,20 @@
 rmed via
+ the
 %0A * %7B@li
@@ -1756,17 +1756,16 @@
 o define
-d
  the ord
@@ -1799,25 +1799,25 @@
  certain
-%0A *
  event
+%0A *
  are inv
@@ -1849,14 +1849,60 @@
 ular
- %7Bco
+%0A * %7B@link org.springframework.core.annotation.Or
 de
+r
  @Or
@@ -2119,18 +2119,23 @@
 ion%7D%0A * 
-a
 s
+o that
  the cal

Fix typos in @EventListener