langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java
changeset 26266 2d24bda701dc
parent 25874 83c19f00452c
child 40232 4995ab1a4558
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java	Tue Aug 26 12:45:28 2014 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacFiler.java	Wed Aug 27 07:44:00 2014 +0200
@@ -52,6 +52,7 @@
 
 import com.sun.tools.javac.code.Lint;
 import com.sun.tools.javac.util.*;
+import com.sun.tools.javac.util.DefinedBy.Api;
 
 import static com.sun.tools.javac.code.Lint.LintCategory.PROCESSING;
 
@@ -120,7 +121,7 @@
             this.name = name;
         }
 
-        @Override
+        @Override @DefinedBy(Api.COMPILER)
         public synchronized OutputStream openOutputStream() throws IOException {
             if (opened)
                 throw new IOException(ALREADY_OPENED);
@@ -128,7 +129,7 @@
             return new FilerOutputStream(name, fileObject);
         }
 
-        @Override
+        @Override @DefinedBy(Api.COMPILER)
         public synchronized Writer openWriter() throws IOException {
             if (opened)
                 throw new IOException(ALREADY_OPENED);
@@ -137,22 +138,22 @@
         }
 
         // Three anti-literacy methods
-        @Override
+        @Override @DefinedBy(Api.COMPILER)
         public InputStream openInputStream() throws IOException {
             throw new IllegalStateException(NOT_FOR_READING);
         }
 
-        @Override
+        @Override @DefinedBy(Api.COMPILER)
         public Reader openReader(boolean ignoreEncodingErrors) throws IOException {
             throw new IllegalStateException(NOT_FOR_READING);
         }
 
-        @Override
+        @Override @DefinedBy(Api.COMPILER)
         public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
             throw new IllegalStateException(NOT_FOR_READING);
         }
 
-        @Override
+        @Override @DefinedBy(Api.COMPILER)
         public boolean delete() {
             return false;
         }
@@ -165,19 +166,23 @@
             this.javaFileObject = javaFileObject;
         }
 
+        @DefinedBy(Api.COMPILER)
         public JavaFileObject.Kind getKind() {
             return javaFileObject.getKind();
         }
 
+        @DefinedBy(Api.COMPILER)
         public boolean isNameCompatible(String simpleName,
                                         JavaFileObject.Kind kind) {
             return javaFileObject.isNameCompatible(simpleName, kind);
         }
 
+        @DefinedBy(Api.COMPILER)
         public NestingKind getNestingKind() {
             return javaFileObject.getNestingKind();
         }
 
+        @DefinedBy(Api.COMPILER)
         public Modifier getAccessLevel() {
             return javaFileObject.getAccessLevel();
         }
@@ -191,17 +196,17 @@
             super(fileObject);
         }
 
-        @Override
+        @Override @DefinedBy(Api.COMPILER)
         public OutputStream openOutputStream() throws IOException {
             throw new IllegalStateException(NOT_FOR_WRITING);
         }
 
-        @Override
+        @Override @DefinedBy(Api.COMPILER)
         public Writer openWriter() throws IOException {
             throw new IllegalStateException(NOT_FOR_WRITING);
         }
 
-        @Override
+        @Override @DefinedBy(Api.COMPILER)
         public boolean delete() {
             return false;
         }
@@ -214,19 +219,23 @@
             this.javaFileObject = javaFileObject;
         }
 
+        @DefinedBy(Api.COMPILER)
         public JavaFileObject.Kind getKind() {
             return javaFileObject.getKind();
         }
 
+        @DefinedBy(Api.COMPILER)
         public boolean isNameCompatible(String simpleName,
                                         JavaFileObject.Kind kind) {
             return javaFileObject.isNameCompatible(simpleName, kind);
         }
 
+        @DefinedBy(Api.COMPILER)
         public NestingKind getNestingKind() {
             return javaFileObject.getNestingKind();
         }
 
+        @DefinedBy(Api.COMPILER)
         public Modifier getAccessLevel() {
             return javaFileObject.getAccessLevel();
         }
@@ -373,11 +382,13 @@
         lint = (Lint.instance(context)).isEnabled(PROCESSING);
     }
 
+    @DefinedBy(Api.ANNOTATION_PROCESSING)
     public JavaFileObject createSourceFile(CharSequence name,
                                            Element... originatingElements) throws IOException {
         return createSourceOrClassFile(true, name.toString());
     }
 
+    @DefinedBy(Api.ANNOTATION_PROCESSING)
     public JavaFileObject createClassFile(CharSequence name,
                                            Element... originatingElements) throws IOException {
         return createSourceOrClassFile(false, name.toString());
@@ -415,6 +426,7 @@
         return new FilerOutputJavaFileObject(name, fileObject);
     }
 
+    @DefinedBy(Api.ANNOTATION_PROCESSING)
     public FileObject createResource(JavaFileManager.Location location,
                                      CharSequence pkg,
                                      CharSequence relativeName,
@@ -445,6 +457,7 @@
         }
     }
 
+    @DefinedBy(Api.ANNOTATION_PROCESSING)
     public FileObject getResource(JavaFileManager.Location location,
                                   CharSequence pkg,
                                   CharSequence relativeName) throws IOException {