author | phh |
Sat, 30 Nov 2019 14:33:05 -0800 | |
changeset 59330 | 5b96c12f909d |
parent 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 |
* |
|
54817 | 35 |
* @jls 7.3 Compilation Units |
36 |
* @jls 7.4 Package Declarations |
|
10 | 37 |
* |
38 |
* @author Peter von der Ahé |
|
39 |
* @since 1.6 |
|
40 |
*/ |
|
41 |
public interface CompilationUnitTree extends Tree { |
|
25287 | 42 |
/** |
43 |
* Returns the annotations listed on any package declaration |
|
44 |
* at the head of this compilation unit, or {@code null} if there |
|
45 |
* is no package declaration. |
|
46 |
* @return the package annotations |
|
47 |
*/ |
|
10 | 48 |
List<? extends AnnotationTree> getPackageAnnotations(); |
25287 | 49 |
|
50 |
/** |
|
51 |
* Returns the name contained in any package declaration |
|
52 |
* at the head of this compilation unit, or {@code null} if there |
|
53 |
* is no package declaration. |
|
54 |
* @return the package name |
|
55 |
*/ |
|
10 | 56 |
ExpressionTree getPackageName(); |
24069 | 57 |
|
58 |
/** |
|
25287 | 59 |
* Returns the package tree associated with this compilation unit, |
60 |
* or {@code null} if there is no package declaration. |
|
61 |
* @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
|
62 |
* @since 9 |
24069 | 63 |
*/ |
64 |
PackageTree getPackage(); |
|
25287 | 65 |
|
66 |
/** |
|
67 |
* Returns the import declarations appearing in this compilation unit. |
|
68 |
* @return the import declarations |
|
69 |
*/ |
|
10 | 70 |
List<? extends ImportTree> getImports(); |
25287 | 71 |
|
72 |
/** |
|
73 |
* Returns the type declarations appearing in this compilation unit. |
|
74 |
* The list may also include empty statements resulting from |
|
75 |
* extraneous semicolons. |
|
76 |
* @return the type declarations |
|
77 |
*/ |
|
10 | 78 |
List<? extends Tree> getTypeDecls(); |
25287 | 79 |
|
80 |
/** |
|
81 |
* Returns the file object containing the source for this compilation unit. |
|
82 |
* @return the file object |
|
83 |
*/ |
|
10 | 84 |
JavaFileObject getSourceFile(); |
85 |
||
86 |
/** |
|
25287 | 87 |
* Returns the line map for this compilation unit, if available. |
88 |
* Returns {@code null} if the line map is not available. |
|
10 | 89 |
* @return the line map for this compilation unit |
90 |
*/ |
|
91 |
LineMap getLineMap(); |
|
92 |
} |