001    /*
002     * Copyright 2013 Erik Kuefler
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
005     * in compliance with the License. You may obtain a copy of the License at
006     *
007     * http://www.apache.org/licenses/LICENSE-2.0
008     *
009     * Unless required by applicable law or agreed to in writing, software distributed under the License
010     * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
011     * or implied. See the License for the specific language governing permissions and limitations under
012     * the License.
013     */
014    package com.ekuefler.supereventbus.multievent;
015    
016    import java.lang.annotation.Documented;
017    import java.lang.annotation.ElementType;
018    import java.lang.annotation.Inherited;
019    import java.lang.annotation.Target;
020    
021    /**
022     * An annotation that, when applied to a parameter of type {@link MultiEvent}, specifies which types
023     * of events that method should listen for. See {@link MultiEvent} for more details and examples.
024     * <p>
025     * This annotation must be applied only to parameters of type {@link MultiEvent} on methods
026     * annotated with {@link com.ekuefler.supereventbus.Subscribe}.
027     *
028     * @author ekuefler@gmail.com (Erik Kuefler)
029     */
030    @Documented
031    @Inherited
032    @Target(value = ElementType.PARAMETER)
033    public @interface EventTypes {
034      /**
035       * The list of types for which this event handler should listen. A posted event will cause the
036       * underlying event handler to be invoked if an only if it is assignable to one of the types in
037       * this list. Classes in this list must not be assignable to any other classes in this list.
038       */
039      Class<?>[] value();
040    }