1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/share/classes/javax/tools/package-info.java Wed Apr 27 01:34:52 2016 +0800 1.3 @@ -0,0 +1,78 @@ 1.4 +/* 1.5 + * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 + * 1.8 + * This code is free software; you can redistribute it and/or modify it 1.9 + * under the terms of the GNU General Public License version 2 only, as 1.10 + * published by the Free Software Foundation. Oracle designates this 1.11 + * particular file as subject to the "Classpath" exception as provided 1.12 + * by Oracle in the LICENSE file that accompanied this code. 1.13 + * 1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.17 + * version 2 for more details (a copy is included in the LICENSE file that 1.18 + * accompanied this code). 1.19 + * 1.20 + * You should have received a copy of the GNU General Public License version 1.21 + * 2 along with this work; if not, write to the Free Software Foundation, 1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.23 + * 1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.25 + * or visit www.oracle.com if you need additional information or have any 1.26 + * questions. 1.27 + */ 1.28 + 1.29 +/** 1.30 + * Provides interfaces for tools which can be invoked from a program, 1.31 + * for example, compilers. 1.32 + * 1.33 + * <p>These interfaces and classes are required as part of the 1.34 + * Java™ Platform, Standard Edition (Java SE), 1.35 + * but there is no requirement to provide any tools implementing them. 1.36 + * 1.37 + * <p>Unless explicitly allowed, all methods in this package might 1.38 + * throw a {@linkplain java.lang.NullPointerException} if given a 1.39 + * {@code null} argument or if given a 1.40 + * {@linkplain java.lang.Iterable list or collection} containing 1.41 + * {@code null} elements. Similarly, no method may return 1.42 + * {@code null} unless explicitly allowed. 1.43 + * 1.44 + * <p>This package is the home of the Java programming language compiler framework. This 1.45 + * framework allows clients of the framework to locate and run 1.46 + * compilers from programs. The framework also provides Service 1.47 + * Provider Interfaces (SPI) for structured access to diagnostics 1.48 + * ({@linkplain javax.tools.DiagnosticListener}) as well as a file 1.49 + * abstraction for overriding file access ({@linkplain 1.50 + * javax.tools.JavaFileManager} and {@linkplain 1.51 + * javax.tools.JavaFileObject}). See {@linkplain 1.52 + * javax.tools.JavaCompiler} for more details on using the SPI. 1.53 + * 1.54 + * <p>There is no requirement for a compiler at runtime. However, if 1.55 + * a default compiler is provided, it can be located using the 1.56 + * {@linkplain javax.tools.ToolProvider}, for example: 1.57 + * 1.58 + * <p>{@code JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();} 1.59 + * 1.60 + * <p>It is possible to provide alternative compilers or tools 1.61 + * through the {@linkplain java.util.ServiceLoader service provider 1.62 + * mechanism}. 1.63 + * 1.64 + * <p>For example, if {@code com.vendor.VendorJavaCompiler} is a 1.65 + * provider of the {@code JavaCompiler} tool then its jar file 1.66 + * would contain the file {@code 1.67 + * META-INF/services/javax.tools.JavaCompiler}. This file would 1.68 + * contain the single line: 1.69 + * 1.70 + * <p>{@code com.vendor.VendorJavaCompiler} 1.71 + * 1.72 + * <p>If the jar file is on the class path, VendorJavaCompiler can be 1.73 + * located using code like this: 1.74 + * 1.75 + * <p>{@code JavaCompiler compiler = ServiceLoader.load(JavaCompiler.class).iterator().next();} 1.76 + * 1.77 + * @author Peter von der Ahé 1.78 + * @author Jonathan Gibbons 1.79 + * @since 1.6 1.80 + */ 1.81 +package javax.tools;