author | chegar |
Sun, 17 Aug 2014 15:52:32 +0100 | |
changeset 25874 | 83c19f00452c |
parent 25287 | langtools/src/share/classes/com/sun/source/tree/CompilationUnitTree.java@d2440361b323 |
child 34912 | 954fa9df99c7 |
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 |
*/ |
|
20612 | 40 |
@jdk.Exported |
10 | 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 |
|
24069 | 62 |
* @since 1.9 |
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 |
} |