langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java
changeset 26266 2d24bda701dc
parent 25874 83c19f00452c
child 26781 a786b07c7b91
equal deleted inserted replaced
26265:46aacfffd3b5 26266:2d24bda701dc
    62 import com.sun.tools.javac.util.Abort;
    62 import com.sun.tools.javac.util.Abort;
    63 import com.sun.tools.javac.util.Assert;
    63 import com.sun.tools.javac.util.Assert;
    64 import com.sun.tools.javac.util.ClientCodeException;
    64 import com.sun.tools.javac.util.ClientCodeException;
    65 import com.sun.tools.javac.util.Context;
    65 import com.sun.tools.javac.util.Context;
    66 import com.sun.tools.javac.util.Convert;
    66 import com.sun.tools.javac.util.Convert;
       
    67 import com.sun.tools.javac.util.DefinedBy;
       
    68 import com.sun.tools.javac.util.DefinedBy.Api;
    67 import com.sun.tools.javac.util.JCDiagnostic;
    69 import com.sun.tools.javac.util.JCDiagnostic;
    68 import com.sun.tools.javac.util.JavacMessages;
    70 import com.sun.tools.javac.util.JavacMessages;
    69 import com.sun.tools.javac.util.List;
    71 import com.sun.tools.javac.util.List;
    70 import com.sun.tools.javac.util.Log;
    72 import com.sun.tools.javac.util.Log;
    71 import com.sun.tools.javac.util.Name;
    73 import com.sun.tools.javac.util.Name;
   755         public ComputeAnnotationSet(Elements elements) {
   757         public ComputeAnnotationSet(Elements elements) {
   756             super();
   758             super();
   757             this.elements = elements;
   759             this.elements = elements;
   758         }
   760         }
   759 
   761 
   760         @Override
   762         @Override @DefinedBy(Api.LANGUAGE_MODEL)
   761         public Set<TypeElement> visitPackage(PackageElement e, Set<TypeElement> p) {
   763         public Set<TypeElement> visitPackage(PackageElement e, Set<TypeElement> p) {
   762             // Don't scan enclosed elements of a package
   764             // Don't scan enclosed elements of a package
   763             return p;
   765             return p;
   764         }
   766         }
   765 
   767 
   766         @Override
   768         @Override @DefinedBy(Api.LANGUAGE_MODEL)
   767         public Set<TypeElement> visitType(TypeElement e, Set<TypeElement> p) {
   769         public Set<TypeElement> visitType(TypeElement e, Set<TypeElement> p) {
   768             // Type parameters are not considered to be enclosed by a type
   770             // Type parameters are not considered to be enclosed by a type
   769             scan(e.getTypeParameters(), p);
   771             scan(e.getTypeParameters(), p);
   770             return super.visitType(e, p);
   772             return super.visitType(e, p);
   771         }
   773         }
   772 
   774 
   773         @Override
   775         @Override @DefinedBy(Api.LANGUAGE_MODEL)
   774         public Set<TypeElement> visitExecutable(ExecutableElement e, Set<TypeElement> p) {
   776         public Set<TypeElement> visitExecutable(ExecutableElement e, Set<TypeElement> p) {
   775             // Type parameters are not considered to be enclosed by an executable
   777             // Type parameters are not considered to be enclosed by an executable
   776             scan(e.getTypeParameters(), p);
   778             scan(e.getTypeParameters(), p);
   777             return super.visitExecutable(e, p);
   779             return super.visitExecutable(e, p);
   778         }
   780         }
   783                 Element e2 = annotationMirror.getAnnotationType().asElement();
   785                 Element e2 = annotationMirror.getAnnotationType().asElement();
   784                 p.add((TypeElement) e2);
   786                 p.add((TypeElement) e2);
   785             }
   787             }
   786         }
   788         }
   787 
   789 
   788         @Override
   790         @Override @DefinedBy(Api.LANGUAGE_MODEL)
   789         public Set<TypeElement> scan(Element e, Set<TypeElement> p) {
   791         public Set<TypeElement> scan(Element e, Set<TypeElement> p) {
   790             addAnnotations(e, p);
   792             addAnnotations(e, p);
   791             return super.scan(e, p);
   793             return super.scan(e, p);
   792         }
   794         }
   793     }
   795     }
  1388      *
  1390      *
  1389      * Command line options suitable for presenting to annotation
  1391      * Command line options suitable for presenting to annotation
  1390      * processors.
  1392      * processors.
  1391      * {@literal "-Afoo=bar"} should be {@literal "-Afoo" => "bar"}.
  1393      * {@literal "-Afoo=bar"} should be {@literal "-Afoo" => "bar"}.
  1392      */
  1394      */
       
  1395     @DefinedBy(Api.ANNOTATION_PROCESSING)
  1393     public Map<String,String> getOptions() {
  1396     public Map<String,String> getOptions() {
  1394         return processorOptions;
  1397         return processorOptions;
  1395     }
  1398     }
  1396 
  1399 
       
  1400     @DefinedBy(Api.ANNOTATION_PROCESSING)
  1397     public Messager getMessager() {
  1401     public Messager getMessager() {
  1398         return messager;
  1402         return messager;
  1399     }
  1403     }
  1400 
  1404 
       
  1405     @DefinedBy(Api.ANNOTATION_PROCESSING)
  1401     public Filer getFiler() {
  1406     public Filer getFiler() {
  1402         return filer;
  1407         return filer;
  1403     }
  1408     }
  1404 
  1409 
       
  1410     @DefinedBy(Api.ANNOTATION_PROCESSING)
  1405     public JavacElements getElementUtils() {
  1411     public JavacElements getElementUtils() {
  1406         return elementUtils;
  1412         return elementUtils;
  1407     }
  1413     }
  1408 
  1414 
       
  1415     @DefinedBy(Api.ANNOTATION_PROCESSING)
  1409     public JavacTypes getTypeUtils() {
  1416     public JavacTypes getTypeUtils() {
  1410         return typeUtils;
  1417         return typeUtils;
  1411     }
  1418     }
  1412 
  1419 
       
  1420     @DefinedBy(Api.ANNOTATION_PROCESSING)
  1413     public SourceVersion getSourceVersion() {
  1421     public SourceVersion getSourceVersion() {
  1414         return Source.toSourceVersion(source);
  1422         return Source.toSourceVersion(source);
  1415     }
  1423     }
  1416 
  1424 
       
  1425     @DefinedBy(Api.ANNOTATION_PROCESSING)
  1417     public Locale getLocale() {
  1426     public Locale getLocale() {
  1418         return messages.getCurrentLocale();
  1427         return messages.getCurrentLocale();
  1419     }
  1428     }
  1420 
  1429 
  1421     public Set<Symbol.PackageSymbol> getSpecifiedPackages() {
  1430     public Set<Symbol.PackageSymbol> getSpecifiedPackages() {