A.java revision 286:44eaac2b4501
175584Sru/* 275584Sru * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. 375584Sru * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 475584Sru * 575584Sru * This code is free software; you can redistribute it and/or modify it 675584Sru * under the terms of the GNU General Public License version 2 only, as 775584Sru * published by the Free Software Foundation. 875584Sru * 975584Sru * This code is distributed in the hope that it will be useful, but WITHOUT 1075584Sru * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1175584Sru * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1275584Sru * version 2 for more details (a copy is included in the LICENSE file that 1375584Sru * accompanied this code). 1475584Sru * 1575584Sru * You should have received a copy of the GNU General Public License version 1675584Sru * 2 along with this work; if not, write to the Free Software Foundation, 1775584Sru * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1875584Sru * 1975584Sru * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2075584Sru * CA 95054 USA or visit www.sun.com if you need additional information or 2175584Sru * have any questions. 2275584Sru */ 2375584Sru 2475584Sru 2575584Sruimport java.util.*; 2675584Sruimport javax.annotation.*; 2775584Sruimport javax.annotation.processing.*; 2875584Sruimport javax.lang.model.*; 2975584Sruimport javax.lang.model.element.*; 3075584Sruimport javax.tools.*; 3175584Sru 3275584Sru@SupportedAnnotationTypes("*") 3375584Sru@SupportedSourceVersion(SourceVersion.RELEASE_7) 3475584Srupublic class A extends AbstractProcessor { 3575584Sru 3675584Sru public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { 3775584Sru Messager m = processingEnv.getMessager(); 3875584Sru for (TypeElement anno: annotations) { 3975584Sru for (Element e: roundEnv.getElementsAnnotatedWith(anno)) 4075584Sru m.printMessage(Diagnostic.Kind.ERROR, "test", e); 4175584Sru 4275584Sru } 4375584Sru return true; 4475584Sru } 4575584Sru} 4675584Sru