author | erikj |
Tue, 12 Sep 2017 19:03:39 +0200 | |
changeset 47216 | 71c04702a3d5 |
parent 34916 | langtools/src/jdk.compiler/share/classes/com/sun/source/tree/CompilationUnitTree.java@16043fc1d90b |
child 54817 | ef73702a906e |
permissions | -rw-r--r-- |
10 | 1 |
/* |
25287 | 2 |
* Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. |
10 | 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 |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 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 |
* |
|
5520 | 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. |
|
10 | 24 |
*/ |
25 |
||
26 |
package com.sun.source.tree; |
|
27 |
||
28 |
import java.util.List; |
|
29 |
import javax.tools.JavaFileObject; |
|
30 |
||
31 |
/** |
|
32 |
* Represents the abstract syntax tree for compilation units (source |
|
33 |
* files) and package declarations (package-info.java). |
|
34 |
* |
|
9303
eae35c201e19
7032975: API files in javax.annotation.processing need to be updated for references to JLS
jjh
parents:
5520
diff
changeset
|
35 |
* @jls sections 7.3, and 7.4 |
10 | 36 |
* |
37 |
* @author Peter von der Ahé |
|
38 |
* @since 1.6 |
|
39 |
*/ |
|
40 |
public interface CompilationUnitTree extends Tree { |
|
25287 | 41 |
/** |
42 |
* Returns the annotations listed on any package declaration |
|
43 |
* at the head of this compilation unit, or {@code null} if there |
|
44 |
* is no package declaration. |
|
45 |
* @return the package annotations |
|
46 |
*/ |
|
10 | 47 |
List<? extends AnnotationTree> getPackageAnnotations(); |
25287 | 48 |
|
49 |
/** |
|
50 |
* Returns the name contained in any package declaration |
|
51 |
* at the head of this compilation unit, or {@code null} if there |
|
52 |
* is no package declaration. |
|
53 |
* @return the package name |
|
54 |
*/ |
|
10 | 55 |
ExpressionTree getPackageName(); |
24069 | 56 |
|
57 |
/** |
|
25287 | 58 |
* Returns the package tree associated with this compilation unit, |
59 |
* or {@code null} if there is no package declaration. |
|
60 |
* @return the package tree |
|
34912
954fa9df99c7
8146572: Update "@since 1.9" to "@since 9" to match java.version.specification [langtools]
jjg
parents:
25874
diff
changeset
|
61 |
* @since 9 |
24069 | 62 |
*/ |
63 |
PackageTree getPackage(); |
|
25287 | 64 |
|
65 |
/** |
|
66 |
* Returns the import declarations appearing in this compilation unit. |
|
67 |
* @return the import declarations |
|
68 |
*/ |
|
10 | 69 |
List<? extends ImportTree> getImports(); |
25287 | 70 |
|
71 |
/** |
|
72 |
* Returns the type declarations appearing in this compilation unit. |
|
73 |
* The list may also include empty statements resulting from |
|
74 |
* extraneous semicolons. |
|
75 |
* @return the type declarations |
|
76 |
*/ |
|
10 | 77 |
List<? extends Tree> getTypeDecls(); |
25287 | 78 |
|
79 |
/** |
|
80 |
* Returns the file object containing the source for this compilation unit. |
|
81 |
* @return the file object |
|
82 |
*/ |
|
10 | 83 |
JavaFileObject getSourceFile(); |
84 |
||
85 |
/** |
|
25287 | 86 |
* Returns the line map for this compilation unit, if available. |
87 |
* Returns {@code null} if the line map is not available. |
|
10 | 88 |
* @return the line map for this compilation unit |
89 |
*/ |
|
90 |
LineMap getLineMap(); |
|
91 |
} |