609N/A/*
609N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
609N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
609N/A *
609N/A * This code is free software; you can redistribute it and/or modify it
609N/A * under the terms of the GNU General Public License version 2 only, as
609N/A * published by the Free Software Foundation.
609N/A *
609N/A * This code is distributed in the hope that it will be useful, but WITHOUT
609N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
609N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
609N/A * version 2 for more details (a copy is included in the LICENSE file that
609N/A * accompanied this code).
609N/A *
609N/A * You should have received a copy of the GNU General Public License version
609N/A * 2 along with this work; if not, write to the Free Software Foundation,
609N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
609N/A *
609N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
609N/A * or visit www.oracle.com if you need additional information or have any
609N/A * questions.
609N/A */
609N/A
609N/Aimport java.io.*;
609N/Aimport java.util.*;
609N/Aimport javax.annotation.processing.*;
609N/Aimport javax.lang.model.*;
609N/Aimport javax.lang.model.element.*;
609N/Aimport javax.tools.*;
609N/A
609N/A@SupportedAnnotationTypes("*")
609N/Apublic class AnnoProc extends AbstractProcessor {
609N/A public boolean process(Set<? extends TypeElement> elems, RoundEnvironment renv) {
609N/A if ((++round) == 1) {
609N/A Filer filer = processingEnv.getFiler();
609N/A Messager messager = processingEnv.getMessager();
609N/A try {
609N/A JavaFileObject fo = filer.createSourceFile("Gen");
609N/A Writer out = fo.openWriter();
609N/A out.write("class Gen { }");
609N/A out.close();
609N/A } catch (IOException e) {
609N/A messager.printMessage(Diagnostic.Kind.ERROR, e.toString());
609N/A }
609N/A }
609N/A return true;
609N/A }
609N/A
609N/A public SourceVersion getSupportedSourceVersion() {
609N/A return SourceVersion.latest();
609N/A }
609N/A
609N/A int round;
609N/A}