001package arez.annotations;
002
003import java.lang.annotation.ElementType;
004import java.lang.annotation.Retention;
005import java.lang.annotation.RetentionPolicy;
006import java.lang.annotation.Target;
007
008/**
009 * Indicate that the named Arez compiler warnings should be suppressed in the
010 * annotated element (and in all program elements contained in the annotated
011 * element).  Note that the set of warnings suppressed in a given element is
012 * a superset of the warnings suppressed in all containing elements.  For
013 * example, if you annotate a class to suppress one warning and annotate a
014 * method to suppress another, both warnings will be suppressed in the method.
015 *
016 * <p>As a matter of style, programmers should always use this annotation
017 * on the most deeply nested element where it is effective.  If you want to
018 * suppress a warning in a particular method, you should annotate that
019 * method rather than its class.</p>
020 *
021 * <p>This class may be used instead of {@link SuppressWarnings} when the compiler
022 * is passed compiled classes. The {@link SuppressWarnings} has a source retention
023 * policy and is thus not available when the files are already compiled and is thus
024 * not useful when attempting to suppress warnings in already compiled code.</p>
025 *
026 * <p>When suppressing Arez processor diagnostics, this annotation is only supported on elements
027 * contained within a type annotated by {@link ArezComponent} or {@link ArezComponentLike} or on the
028 * type itself. Other usages will fail compilation.</p>
029 */
030@Target( { ElementType.TYPE,
031           ElementType.FIELD,
032           ElementType.METHOD,
033           ElementType.PARAMETER,
034           ElementType.CONSTRUCTOR,
035           ElementType.LOCAL_VARIABLE } )
036@Retention( RetentionPolicy.CLASS )
037public @interface SuppressArezWarnings
038{
039  /**
040   * The set of warnings that are to be suppressed by the compiler in the
041   * annotated element. Duplicate names are permitted.  The second and
042   * successive occurrences of a name are ignored.
043   *
044   * @return the set of warnings to be suppressed
045   */
046  String[] value();
047}