< prev index next >

src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java

Print this page


   1 /*
   2  * Copyright (c) 2016, 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


  33 
  34 import javax.annotation.processing.AbstractProcessor;
  35 import javax.annotation.processing.Messager;
  36 import javax.annotation.processing.ProcessingEnvironment;
  37 import javax.annotation.processing.RoundEnvironment;
  38 import javax.annotation.processing.SupportedAnnotationTypes;
  39 import javax.annotation.processing.SupportedSourceVersion;
  40 
  41 import javax.lang.model.element.Element;
  42 import javax.lang.model.element.ElementKind;
  43 import javax.lang.model.element.ExecutableElement;
  44 import javax.lang.model.element.TypeElement;
  45 import javax.lang.model.type.ArrayType;
  46 import javax.lang.model.type.DeclaredType;
  47 import javax.lang.model.type.ExecutableType;
  48 import javax.lang.model.type.TypeMirror;
  49 import javax.lang.model.util.Elements;
  50 
  51 import javax.tools.Diagnostic;
  52 
  53 import static javax.lang.model.SourceVersion.RELEASE_9;
  54 
  55 /**
  56  * Annotation processor for the Deprecation Scanner tool.
  57  * Examines APIs for deprecated elements and records information
  58  *
  59  */
  60 @SupportedAnnotationTypes("java.lang.Deprecated")
  61 @SupportedSourceVersion(RELEASE_9)
  62 public class LoadProc extends AbstractProcessor {
  63     Elements elements;
  64     Messager messager;
  65     final List<DeprData> deprList = new ArrayList<>();
  66 
  67     public LoadProc() {
  68     }
  69 
  70     @Override
  71     public void init(ProcessingEnvironment pe) {
  72         super.init(pe);
  73         elements = pe.getElementUtils();
  74         messager = pe.getMessager();
  75     }
  76 
  77     @Override
  78     public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  79         if (roundEnv.processingOver()) {
  80             return false;
  81         }


   1 /*
   2  * Copyright (c) 2016, 2017, 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


  33 
  34 import javax.annotation.processing.AbstractProcessor;
  35 import javax.annotation.processing.Messager;
  36 import javax.annotation.processing.ProcessingEnvironment;
  37 import javax.annotation.processing.RoundEnvironment;
  38 import javax.annotation.processing.SupportedAnnotationTypes;
  39 import javax.annotation.processing.SupportedSourceVersion;
  40 
  41 import javax.lang.model.element.Element;
  42 import javax.lang.model.element.ElementKind;
  43 import javax.lang.model.element.ExecutableElement;
  44 import javax.lang.model.element.TypeElement;
  45 import javax.lang.model.type.ArrayType;
  46 import javax.lang.model.type.DeclaredType;
  47 import javax.lang.model.type.ExecutableType;
  48 import javax.lang.model.type.TypeMirror;
  49 import javax.lang.model.util.Elements;
  50 
  51 import javax.tools.Diagnostic;
  52 
  53 import static javax.lang.model.SourceVersion.RELEASE_10;
  54 
  55 /**
  56  * Annotation processor for the Deprecation Scanner tool.
  57  * Examines APIs for deprecated elements and records information
  58  *
  59  */
  60 @SupportedAnnotationTypes("java.lang.Deprecated")
  61 @SupportedSourceVersion(RELEASE_10)
  62 public class LoadProc extends AbstractProcessor {
  63     Elements elements;
  64     Messager messager;
  65     final List<DeprData> deprList = new ArrayList<>();
  66 
  67     public LoadProc() {
  68     }
  69 
  70     @Override
  71     public void init(ProcessingEnvironment pe) {
  72         super.init(pe);
  73         elements = pe.getElementUtils();
  74         messager = pe.getMessager();
  75     }
  76 
  77     @Override
  78     public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
  79         if (roundEnv.processingOver()) {
  80             return false;
  81         }


< prev index next >