AnnotationDesc.java revision 2571:10fc81ac75b4
138494Sobrien/*
2174294Sobrien * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
338494Sobrien * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
438494Sobrien *
538494Sobrien * This code is free software; you can redistribute it and/or modify it
638494Sobrien * under the terms of the GNU General Public License version 2 only, as
738494Sobrien * published by the Free Software Foundation.  Oracle designates this
838494Sobrien * particular file as subject to the "Classpath" exception as provided
938494Sobrien * by Oracle in the LICENSE file that accompanied this code.
1038494Sobrien *
1138494Sobrien * This code is distributed in the hope that it will be useful, but WITHOUT
1238494Sobrien * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1338494Sobrien * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1438494Sobrien * version 2 for more details (a copy is included in the LICENSE file that
1538494Sobrien * accompanied this code).
1638494Sobrien *
1738494Sobrien * You should have received a copy of the GNU General Public License version
1838494Sobrien * 2 along with this work; if not, write to the Free Software Foundation,
1938494Sobrien * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2042629Sobrien *
2138494Sobrien * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2238494Sobrien * or visit www.oracle.com if you need additional information or have any
2338494Sobrien * questions.
2438494Sobrien */
2538494Sobrien
2638494Sobrienpackage com.sun.javadoc;
2738494Sobrien
2838494Sobrien
2938494Sobrien/**
3038494Sobrien * Represents an annotation.
3138494Sobrien * An annotation associates a value with each element of an annotation type.
3238494Sobrien *
3338494Sobrien * @author Scott Seligman
3438494Sobrien * @since 1.5
3538494Sobrien */
3638494Sobrienpublic interface AnnotationDesc {
3738494Sobrien
3838494Sobrien    /**
3938494Sobrien     * Returns the annotation type of this annotation.
40174294Sobrien     *
4138494Sobrien     * @return the annotation type of this annotation.
4238494Sobrien     */
4338494Sobrien    AnnotationTypeDoc annotationType();
4438494Sobrien
4538494Sobrien    /**
4638494Sobrien     * Returns this annotation's elements and their values.
4738494Sobrien     * Only those explicitly present in the annotation are
4838494Sobrien     * included, not those assuming their default values.
4938494Sobrien     * Returns an empty array if there are none.
5038494Sobrien     *
5138494Sobrien     * @return this annotation's elements and their values.
5238494Sobrien     */
5338494Sobrien    ElementValuePair[] elementValues();
5438494Sobrien
5582794Sobrien    /**
56174294Sobrien     * Check for the synthesized bit on the annotation.
57174294Sobrien     *
5838494Sobrien     * @return true if the annotation is synthesized.
5938494Sobrien     */
6038494Sobrien    boolean isSynthesized();
6138494Sobrien
6238494Sobrien    /**
6338494Sobrien     * Represents an association between an annotation type element
6438494Sobrien     * and one of its values.
6538494Sobrien     *
6638494Sobrien     * @author Scott Seligman
67174294Sobrien     * @since 1.5
68174294Sobrien     */
69174294Sobrien    public interface ElementValuePair {
70174294Sobrien
7138494Sobrien        /**
7238494Sobrien         * Returns the annotation type element.
7338494Sobrien         *
7438494Sobrien         * @return the annotation type element.
75174294Sobrien         */
76174294Sobrien        AnnotationTypeElementDoc element();
77174294Sobrien
78174294Sobrien        /**
79174294Sobrien         * Returns the value associated with the annotation type element.
80174294Sobrien         *
8138494Sobrien         * @return the value associated with the annotation type element.
8238494Sobrien         */
8338494Sobrien        AnnotationValue value();
8438494Sobrien    }
8538494Sobrien}
8638494Sobrien