Wed, 13 Apr 2011 11:35:43 -0700
7032975: API files in javax.annotation.processing need to be updated for references to JLS
7032972: API files in javax.tools need to updated for references to JVM Spec with editions/hyperlinks
7032978: API files in javax.tools need to be updated for references to JLS with editions/hyperlinks
Summary: Removed URLs and 'edition' references
Reviewed-by: jjg, darcy
1 /*
2 * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
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
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
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 *
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.
24 */
26 package javax.tools;
28 import java.io.IOException;
29 import java.io.InputStream;
30 import java.io.OutputStream;
31 import java.io.Reader;
32 import java.io.Writer;
33 import java.nio.CharBuffer;
34 import javax.lang.model.element.NestingKind;
35 import javax.lang.model.element.Modifier;
37 /**
38 * File abstraction for tools operating on Java™ programming language
39 * source and class files.
40 *
41 * <p>All methods in this interface might throw a SecurityException if
42 * a security exception occurs.
43 *
44 * <p>Unless explicitly allowed, all methods in this interface might
45 * throw a NullPointerException if given a {@code null} argument.
46 *
47 * @author Peter von der Ahé
48 * @author Jonathan Gibbons
49 * @see JavaFileManager
50 * @since 1.6
51 */
52 public interface JavaFileObject extends FileObject {
54 /**
55 * Kinds of JavaFileObjects.
56 */
57 enum Kind {
58 /**
59 * Source files written in the Java programming language. For
60 * example, regular files ending with {@code .java}.
61 */
62 SOURCE(".java"),
64 /**
65 * Class files for the Java Virtual Machine. For example,
66 * regular files ending with {@code .class}.
67 */
68 CLASS(".class"),
70 /**
71 * HTML files. For example, regular files ending with {@code
72 * .html}.
73 */
74 HTML(".html"),
76 /**
77 * Any other kind.
78 */
79 OTHER("");
80 /**
81 * The extension which (by convention) is normally used for
82 * this kind of file object. If no convention exists, the
83 * empty string ({@code ""}) is used.
84 */
85 public final String extension;
86 private Kind(String extension) {
87 extension.getClass(); // null check
88 this.extension = extension;
89 }
90 };
92 /**
93 * Gets the kind of this file object.
94 *
95 * @return the kind
96 */
97 Kind getKind();
99 /**
100 * Checks if this file object is compatible with the specified
101 * simple name and kind. A simple name is a single identifier
102 * (not qualified) as defined in
103 * <cite>The Java™ Language Specification</cite>,
104 * section 6.2 "Names and Identifiers".
105 *
106 * @param simpleName a simple name of a class
107 * @param kind a kind
108 * @return {@code true} if this file object is compatible; false
109 * otherwise
110 */
111 boolean isNameCompatible(String simpleName, Kind kind);
113 /**
114 * Provides a hint about the nesting level of the class
115 * represented by this file object. This method may return
116 * {@link NestingKind#MEMBER} to mean
117 * {@link NestingKind#LOCAL} or {@link NestingKind#ANONYMOUS}.
118 * If the nesting level is not known or this file object does not
119 * represent a class file this method returns {@code null}.
120 *
121 * @return the nesting kind, or {@code null} if the nesting kind
122 * is not known
123 */
124 NestingKind getNestingKind();
126 /**
127 * Provides a hint about the access level of the class represented
128 * by this file object. If the access level is not known or if
129 * this file object does not represent a class file this method
130 * returns {@code null}.
131 *
132 * @return the access level
133 */
134 Modifier getAccessLevel();
136 }