src/share/classes/javax/lang/model/element/AnnotationValue.java

Fri, 28 Jan 2011 16:54:18 -0800

author
darcy
date
Fri, 28 Jan 2011 16:54:18 -0800
changeset 849
7a75a1803c7a
parent 554
9d9f26857129
child 1357
c75be5bc5283
permissions
-rw-r--r--

7015530: Reiterate API specializations in javax.lang.model.elment subinterfaces
Reviewed-by: jjg

     1 /*
     2  * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    26 package javax.lang.model.element;
    29 import java.util.List;
    30 import javax.lang.model.type.*;
    32 /**
    33  * Represents a value of an annotation type element.
    34  * A value is of one of the following types:
    35  * <ul><li> a wrapper class (such as {@link Integer}) for a primitive type
    36  *     <li> {@code String}
    37  *     <li> {@code TypeMirror}
    38  *     <li> {@code VariableElement} (representing an enum constant)
    39  *     <li> {@code AnnotationMirror}
    40  *     <li> {@code List<? extends AnnotationValue>}
    41  *              (representing the elements, in declared order, if the value is an array)
    42  * </ul>
    43  *
    44  * @author Joseph D. Darcy
    45  * @author Scott Seligman
    46  * @author Peter von der Ah&eacute;
    47  * @since 1.6
    48  */
    49 public interface AnnotationValue {
    51     /**
    52      * Returns the value.
    53      *
    54      * @return the value
    55      */
    56     Object getValue();
    58     /**
    59      * Returns a string representation of this value.
    60      * This is returned in a form suitable for representing this value
    61      * in the source code of an annotation.
    62      *
    63      * @return a string representation of this value
    64      */
    65     String toString();
    67     /**
    68      * Applies a visitor to this value.
    69      *
    70      * @param <R> the return type of the visitor's methods
    71      * @param <P> the type of the additional parameter to the visitor's methods
    72      * @param v   the visitor operating on this value
    73      * @param p   additional parameter to the visitor
    74      * @return a visitor-specified result
    75      */
    76     <R, P> R accept(AnnotationValueVisitor<R, P> v, P p);
    77 }

mercurial