A.java revision 3170:dc017a37aac5
1139969Simp/* 21556Srgrimes * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. 31556Srgrimes * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 41556Srgrimes * 51556Srgrimes * This code is free software; you can redistribute it and/or modify it 61556Srgrimes * under the terms of the GNU General Public License version 2 only, as 71556Srgrimes * published by the Free Software Foundation. 81556Srgrimes * 91556Srgrimes * This code is distributed in the hope that it will be useful, but WITHOUT 101556Srgrimes * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 111556Srgrimes * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 121556Srgrimes * version 2 for more details (a copy is included in the LICENSE file that 131556Srgrimes * accompanied this code). 141556Srgrimes * 151556Srgrimes * You should have received a copy of the GNU General Public License version 161556Srgrimes * 2 along with this work; if not, write to the Free Software Foundation, 171556Srgrimes * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 181556Srgrimes * 191556Srgrimes * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 201556Srgrimes * or visit www.oracle.com if you need additional information or have any 211556Srgrimes * questions. 221556Srgrimes */ 231556Srgrimes 241556Srgrimesimport java.util.*; 251556Srgrimesimport javax.annotation.*; 261556Srgrimesimport javax.annotation.processing.*; 271556Srgrimesimport javax.lang.model.*; 281556Srgrimesimport javax.lang.model.element.*; 291556Srgrimesimport javax.tools.*; 301556Srgrimes 3120413Ssteve@SuppressWarnings("") 321556Srgrimespublic class A extends JavacTestingAbstractProcessor { 331556Srgrimes public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { 341556Srgrimes Messager m = processingEnv.getMessager(); 351556Srgrimes for (TypeElement anno: annotations) { 36110390Scharnier for (Element e: roundEnv.getElementsAnnotatedWith(anno)) 371556Srgrimes m.printMessage(Diagnostic.Kind.ERROR, "test", e); 3836006Scharnier 39110390Scharnier } 4035773Scharnier return true; 41110390Scharnier } 4299109Sobrien 4399109Sobrien @SuppressWarnings("") 441556Srgrimes private void foo() {} 4536006Scharnier} 461556Srgrimes