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