0N/A/*
553N/A * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
553N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
553N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
553N/A * or visit www.oracle.com if you need additional information or have any
553N/A * questions.
0N/A */
0N/A
0N/Apackage javax.annotation.processing;
0N/A
0N/Aimport java.util.Map;
0N/Aimport java.util.List;
0N/Aimport java.util.Locale;
0N/Aimport javax.lang.model.SourceVersion;
0N/Aimport javax.lang.model.util.Elements;
0N/Aimport javax.lang.model.util.Types;
0N/Aimport java.io.File;
0N/A
0N/A/**
0N/A * An annotation processing tool framework will {@linkplain
0N/A * Processor#init provide an annotation processor with an object
0N/A * implementing this interface} so the processor can use facilities
0N/A * provided by the framework to write new files, report error
0N/A * messages, and find other utilities.
0N/A *
0N/A * <p>Third parties may wish to provide value-add wrappers around the
0N/A * facility objects from this interface, for example a {@code Filer}
0N/A * extension that allows multiple processors to coordinate writing out
0N/A * a single source file. To enable this, for processors running in a
0N/A * context where their side effects via the API could be visible to
0N/A * each other, the tool infrastructure must provide corresponding
0N/A * facility objects that are {@code .equals}, {@code Filer}s that are
0N/A * {@code .equals}, and so on. In addition, the tool invocation must
0N/A * be able to be configured such that from the perspective of the
0N/A * running annotation processors, at least the chosen subset of helper
0N/A * classes are viewed as being loaded by the same class loader.
0N/A * (Since the facility objects manage shared state, the implementation
0N/A * of a wrapper class must know whether or not the same base facility
0N/A * object has been wrapped before.)
0N/A *
0N/A * @author Joseph D. Darcy
0N/A * @author Scott Seligman
0N/A * @author Peter von der Ah&eacute;
0N/A * @since 1.6
0N/A */
0N/Apublic interface ProcessingEnvironment {
0N/A /**
0N/A * Returns the processor-specific options passed to the annotation
0N/A * processing tool. Options are returned in the form of a map from
0N/A * option name to option value. For an option with no value, the
0N/A * corresponding value in the map is {@code null}.
0N/A *
0N/A * <p>See documentation of the particular tool infrastructure
0N/A * being used for details on how to pass in processor-specific
0N/A * options. For example, a command-line implementation may
0N/A * distinguish processor-specific options by prefixing them with a
0N/A * known string like {@code "-A"}; other tool implementations may
0N/A * follow different conventions or provide alternative mechanisms.
0N/A * A given implementation may also provide implementation-specific
0N/A * ways of finding options passed to the tool in addition to the
0N/A * processor-specific options.
0N/A *
0N/A * @return the processor-specific options passed to the tool
0N/A */
0N/A Map<String,String> getOptions();
0N/A
0N/A /**
0N/A * Returns the messager used to report errors, warnings, and other
0N/A * notices.
0N/A *
0N/A * @return the messager
0N/A */
0N/A Messager getMessager();
0N/A
0N/A /**
0N/A * Returns the filer used to create new source, class, or auxiliary
0N/A * files.
0N/A *
0N/A * @return the filer
0N/A */
0N/A Filer getFiler();
0N/A
0N/A /**
0N/A * Returns an implementation of some utility methods for
0N/A * operating on elements
0N/A *
0N/A * @return element utilities
0N/A */
0N/A Elements getElementUtils();
0N/A
0N/A /**
0N/A * Returns an implementation of some utility methods for
0N/A * operating on types.
0N/A *
0N/A * @return type utilities
0N/A */
0N/A Types getTypeUtils();
0N/A
0N/A /**
0N/A * Returns the source version that any generated {@linkplain
0N/A * Filer#createSourceFile source} and {@linkplain
0N/A * Filer#createClassFile class} files should conform to.
0N/A *
0N/A * @return the source version to which generated source and class
0N/A * files should conform to
0N/A * @see Processor#getSupportedSourceVersion
0N/A */
0N/A SourceVersion getSourceVersion();
0N/A
0N/A /**
0N/A * Returns the current locale or {@code null} if no locale is in
0N/A * effect. The locale can be be used to provide localized
0N/A * {@linkplain Messager messages}.
0N/A *
0N/A * @return the current locale or {@code null} if no locale is in
0N/A * effect
0N/A */
0N/A Locale getLocale();
0N/A}