aoqi@0: /* aoqi@0: * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: /** aoqi@0: * Provides interfaces for tools which can be invoked from a program, aoqi@0: * for example, compilers. aoqi@0: * aoqi@0: *

These interfaces and classes are required as part of the aoqi@0: * Java™ Platform, Standard Edition (Java SE), aoqi@0: * but there is no requirement to provide any tools implementing them. aoqi@0: * aoqi@0: *

Unless explicitly allowed, all methods in this package might aoqi@0: * throw a {@linkplain java.lang.NullPointerException} if given a aoqi@0: * {@code null} argument or if given a aoqi@0: * {@linkplain java.lang.Iterable list or collection} containing aoqi@0: * {@code null} elements. Similarly, no method may return aoqi@0: * {@code null} unless explicitly allowed. aoqi@0: * aoqi@0: *

This package is the home of the Java programming language compiler framework. This aoqi@0: * framework allows clients of the framework to locate and run aoqi@0: * compilers from programs. The framework also provides Service aoqi@0: * Provider Interfaces (SPI) for structured access to diagnostics aoqi@0: * ({@linkplain javax.tools.DiagnosticListener}) as well as a file aoqi@0: * abstraction for overriding file access ({@linkplain aoqi@0: * javax.tools.JavaFileManager} and {@linkplain aoqi@0: * javax.tools.JavaFileObject}). See {@linkplain aoqi@0: * javax.tools.JavaCompiler} for more details on using the SPI. aoqi@0: * aoqi@0: *

There is no requirement for a compiler at runtime. However, if aoqi@0: * a default compiler is provided, it can be located using the aoqi@0: * {@linkplain javax.tools.ToolProvider}, for example: aoqi@0: * aoqi@0: *

{@code JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();} aoqi@0: * aoqi@0: *

It is possible to provide alternative compilers or tools aoqi@0: * through the {@linkplain java.util.ServiceLoader service provider aoqi@0: * mechanism}. aoqi@0: * aoqi@0: *

For example, if {@code com.vendor.VendorJavaCompiler} is a aoqi@0: * provider of the {@code JavaCompiler} tool then its jar file aoqi@0: * would contain the file {@code aoqi@0: * META-INF/services/javax.tools.JavaCompiler}. This file would aoqi@0: * contain the single line: aoqi@0: * aoqi@0: *

{@code com.vendor.VendorJavaCompiler} aoqi@0: * aoqi@0: *

If the jar file is on the class path, VendorJavaCompiler can be aoqi@0: * located using code like this: aoqi@0: * aoqi@0: *

{@code JavaCompiler compiler = ServiceLoader.load(JavaCompiler.class).iterator().next();} aoqi@0: * aoqi@0: * @author Peter von der Ahé aoqi@0: * @author Jonathan Gibbons aoqi@0: * @since 1.6 aoqi@0: */ aoqi@0: package javax.tools;