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.tools;
0N/A
0N/Aimport java.util.Set;
0N/Aimport java.io.InputStream;
0N/Aimport java.io.OutputStream;
0N/Aimport javax.lang.model.SourceVersion;
0N/A
0N/A/**
0N/A * Common interface for tools that can be invoked from a program.
0N/A * A tool is traditionally a command line program such as a compiler.
0N/A * The set of tools available with a platform is defined by the
0N/A * vendor.
0N/A *
0N/A * <p>Tools can be located using {@link
0N/A * java.util.ServiceLoader#load(Class)}.
0N/A *
0N/A * @author Neal M Gafter
0N/A * @author Peter von der Ah&eacute;
0N/A * @author Jonathan Gibbons
0N/A * @since 1.6
0N/A */
0N/Apublic interface Tool {
0N/A
0N/A /**
0N/A * Run the tool with the given I/O channels and arguments. By
0N/A * convention a tool returns 0 for success and nonzero for errors.
0N/A * Any diagnostics generated will be written to either {@code out}
0N/A * or {@code err} in some unspecified format.
0N/A *
0N/A * @param in "standard" input; use System.in if null
0N/A * @param out "standard" output; use System.out if null
0N/A * @param err "standard" error; use System.err if null
0N/A * @param arguments arguments to pass to the tool
0N/A * @return 0 for success; nonzero otherwise
0N/A * @throws NullPointerException if the array of arguments contains
0N/A * any {@code null} elements.
0N/A */
0N/A int run(InputStream in, OutputStream out, OutputStream err, String... arguments);
0N/A
0N/A /**
0N/A * Gets the source versions of the Java&trade; programming language
0N/A * supported by this tool.
0N/A * @return a set of supported source versions
0N/A */
0N/A Set<SourceVersion> getSourceVersions();
0N/A
0N/A}