src/share/classes/javax/lang/model/element/package-info.java

Tue, 09 Oct 2012 19:10:00 -0700

author
jjg
date
Tue, 09 Oct 2012 19:10:00 -0700
changeset 1357
c75be5bc5283
parent 778
23fc45d3a572
child 1484
7612fe48be90
permissions
-rw-r--r--

8000663: clean up langtools imports
Reviewed-by: darcy

duke@1 1 /*
darcy@778 2 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
duke@1 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@1 4 *
duke@1 5 * This code is free software; you can redistribute it and/or modify it
duke@1 6 * under the terms of the GNU General Public License version 2 only, as
ohair@554 7 * published by the Free Software Foundation. Oracle designates this
duke@1 8 * particular file as subject to the "Classpath" exception as provided
ohair@554 9 * by Oracle in the LICENSE file that accompanied this code.
duke@1 10 *
duke@1 11 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@1 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@1 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@1 14 * version 2 for more details (a copy is included in the LICENSE file that
duke@1 15 * accompanied this code).
duke@1 16 *
duke@1 17 * You should have received a copy of the GNU General Public License version
duke@1 18 * 2 along with this work; if not, write to the Free Software Foundation,
duke@1 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@1 20 *
ohair@554 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@554 22 * or visit www.oracle.com if you need additional information or have any
ohair@554 23 * questions.
duke@1 24 */
duke@1 25
duke@1 26 /**
duke@1 27 * Interfaces used to model elements of the Java programming language.
duke@1 28 *
darcy@449 29 * The term "element" in this package is used to refer to program
darcy@449 30 * elements, the declared entities that make up a program. Elements
darcy@449 31 * include classes, interfaces, methods, constructors, and fields.
darcy@449 32 * The interfaces in this package do not model the structure of a
darcy@449 33 * program inside a method body; for example there is no
darcy@449 34 * representation of a {@code for} loop or {@code try}-{@code finally}
darcy@449 35 * block. However, the interfaces can model some structures only
darcy@449 36 * appearing inside method bodies, such as local variables and
darcy@449 37 * anonymous classes.
darcy@449 38 *
duke@1 39 * <p>When used in the context of annotation processing, an accurate
duke@1 40 * model of the element being represented must be returned. As this
duke@1 41 * is a language model, the source code provides the fiducial
duke@1 42 * (reference) representation of the construct in question rather than
duke@1 43 * a representation in an executable output like a class file.
duke@1 44 * Executable output may serve as the basis for creating a modeling
duke@1 45 * element. However, the process of translating source code to
duke@1 46 * executable output may not permit recovering some aspects of the
duke@1 47 * source code representation. For example, annotations with
duke@1 48 * {@linkplain java.lang.annotation.RetentionPolicy#SOURCE source}
duke@1 49 * {@linkplain java.lang.annotation.Retention retention} cannot be
duke@1 50 * recovered from class files and class files might not be able to
duke@1 51 * provide source position information. The {@linkplain
duke@1 52 * javax.lang.model.element.Modifier modifiers} on an element may
duke@1 53 * differ in some cases including
duke@1 54 *
duke@1 55 * <ul>
duke@1 56 * <li> {@code strictfp} on a class or interface
duke@1 57 * <li> {@code final} on a parameter
duke@1 58 * <li> {@code protected}, {@code private}, and {@code static} on classes and interfaces
duke@1 59 * </ul>
duke@1 60 *
duke@1 61 * Additionally, synthetic constructs in a class file, such as
duke@1 62 * accessor methods used in implementing nested classes and bridge
duke@1 63 * methods used in implementing covariant returns, are translation
duke@1 64 * artifacts outside of this model.
duke@1 65 *
duke@1 66 * <p>During annotation processing, operating on incomplete or
duke@1 67 * erroneous programs is necessary; however, there are fewer
duke@1 68 * guarantees about the nature of the resulting model. If the source
darcy@778 69 * code is not syntactically well-formed or has some other
darcy@778 70 * irrecoverable error that could not be removed by the generation of
darcy@778 71 * new types, a model may or may not be provided as a quality of
darcy@778 72 * implementation issue.
darcy@778 73 * If a program is syntactically valid but erroneous in some other
darcy@778 74 * fashion, any returned model must have no less information than if
darcy@778 75 * all the method bodies in the program were replaced by {@code "throw
darcy@778 76 * new RuntimeException();"}. If a program refers to a missing type XYZ,
duke@1 77 * the returned model must contain no less information than if the
duke@1 78 * declaration of type XYZ were assumed to be {@code "class XYZ {}"},
duke@1 79 * {@code "interface XYZ {}"}, {@code "enum XYZ {}"}, or {@code
duke@1 80 * "@interface XYZ {}"}. If a program refers to a missing type {@code
duke@1 81 * XYZ<K1, ... ,Kn>}, the returned model must contain no less
duke@1 82 * information than if the declaration of XYZ were assumed to be
duke@1 83 * {@code "class XYZ<T1, ... ,Tn> {}"} or {@code "interface XYZ<T1,
duke@1 84 * ... ,Tn> {}"}
duke@1 85 *
duke@1 86 * <p> Unless otherwise specified in a particular implementation, the
duke@1 87 * collections returned by methods in this package should be expected
duke@1 88 * to be unmodifiable by the caller and unsafe for concurrent access.
duke@1 89 *
duke@1 90 * <p> Unless otherwise specified, methods in this package will throw
duke@1 91 * a {@code NullPointerException} if given a {@code null} argument.
duke@1 92 *
duke@1 93 * @author Joseph D. Darcy
duke@1 94 * @author Scott Seligman
duke@1 95 * @author Peter von der Ah&eacute;
duke@1 96 * @since 1.6
duke@1 97 */
duke@1 98 package javax.lang.model.element;

mercurial