Tue, 24 Dec 2013 09:17:37 -0800
8029230: Update copyright year to match last edit in jdk8 langtools repository for 2013
Reviewed-by: ksrini
Contributed-by: steve.sides@oracle.com
duke@1 | 1 | /* |
ksrini@2227 | 2 | * Copyright (c) 2005, 2013, 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 |
darcy@1484 | 51 | * provide source position information. |
darcy@1484 | 52 | * |
darcy@1484 | 53 | * Names of parameters may not be recoverable from class files. |
darcy@1484 | 54 | * |
darcy@1484 | 55 | * The {@linkplain javax.lang.model.element.Modifier modifiers} on an |
darcy@1484 | 56 | * element may differ in some cases including: |
duke@1 | 57 | * |
duke@1 | 58 | * <ul> |
duke@1 | 59 | * <li> {@code strictfp} on a class or interface |
duke@1 | 60 | * <li> {@code final} on a parameter |
duke@1 | 61 | * <li> {@code protected}, {@code private}, and {@code static} on classes and interfaces |
duke@1 | 62 | * </ul> |
duke@1 | 63 | * |
duke@1 | 64 | * Additionally, synthetic constructs in a class file, such as |
duke@1 | 65 | * accessor methods used in implementing nested classes and bridge |
duke@1 | 66 | * methods used in implementing covariant returns, are translation |
duke@1 | 67 | * artifacts outside of this model. |
duke@1 | 68 | * |
duke@1 | 69 | * <p>During annotation processing, operating on incomplete or |
duke@1 | 70 | * erroneous programs is necessary; however, there are fewer |
duke@1 | 71 | * guarantees about the nature of the resulting model. If the source |
darcy@778 | 72 | * code is not syntactically well-formed or has some other |
darcy@778 | 73 | * irrecoverable error that could not be removed by the generation of |
darcy@778 | 74 | * new types, a model may or may not be provided as a quality of |
darcy@778 | 75 | * implementation issue. |
darcy@778 | 76 | * If a program is syntactically valid but erroneous in some other |
darcy@778 | 77 | * fashion, any returned model must have no less information than if |
darcy@778 | 78 | * all the method bodies in the program were replaced by {@code "throw |
darcy@778 | 79 | * new RuntimeException();"}. If a program refers to a missing type XYZ, |
duke@1 | 80 | * the returned model must contain no less information than if the |
duke@1 | 81 | * declaration of type XYZ were assumed to be {@code "class XYZ {}"}, |
duke@1 | 82 | * {@code "interface XYZ {}"}, {@code "enum XYZ {}"}, or {@code |
duke@1 | 83 | * "@interface XYZ {}"}. If a program refers to a missing type {@code |
duke@1 | 84 | * XYZ<K1, ... ,Kn>}, the returned model must contain no less |
duke@1 | 85 | * information than if the declaration of XYZ were assumed to be |
duke@1 | 86 | * {@code "class XYZ<T1, ... ,Tn> {}"} or {@code "interface XYZ<T1, |
duke@1 | 87 | * ... ,Tn> {}"} |
duke@1 | 88 | * |
duke@1 | 89 | * <p> Unless otherwise specified in a particular implementation, the |
duke@1 | 90 | * collections returned by methods in this package should be expected |
duke@1 | 91 | * to be unmodifiable by the caller and unsafe for concurrent access. |
duke@1 | 92 | * |
duke@1 | 93 | * <p> Unless otherwise specified, methods in this package will throw |
duke@1 | 94 | * a {@code NullPointerException} if given a {@code null} argument. |
duke@1 | 95 | * |
duke@1 | 96 | * @author Joseph D. Darcy |
duke@1 | 97 | * @author Scott Seligman |
duke@1 | 98 | * @author Peter von der Ahé |
duke@1 | 99 | * @since 1.6 |
duke@1 | 100 | */ |
duke@1 | 101 | package javax.lang.model.element; |