ToolProvider.java revision 553
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Provides methods for locating tool providers, for example,
* providers of compilers. This class complements the
* functionality of {@link java.util.ServiceLoader}.
*
* @author Peter von der Ahé
* @since 1.6
*/
public class ToolProvider {
private ToolProvider() {}
/*
* Define the system property "sun.tools.ToolProvider" to enable
* debugging:
*
* java ... -Dsun.tools.ToolProvider ...
*/
// NOTE: do not make this method private as it affects stack traces
try {
frame.getFileName(),
frame.getLineNumber());
}
} else {
}
}
} catch (SecurityException ex) {
ToolProvider.class.getName(),
}
return null;
}
/**
* Gets the Java™ programming language compiler provided
* with this platform.
* @return the compiler provided with this platform or
* {@code null} if no compiler is provided
*/
public static JavaCompiler getSystemJavaCompiler() {
try {
} catch (Throwable e) {
}
}
/**
* Returns the class loader for tools provided with this platform.
* This does not include user-installed tools. Use the
* {@linkplain java.util.ServiceLoader service provider mechanism}
* for locating user installed tools.
*
* @return the class loader for tools provided with this platform
* or {@code null} if no tools are provided
*/
public static ClassLoader getSystemToolClassLoader() {
}
/**
* This class will not be initialized until one of the above
* methods are called. This ensures that searching for the
* compiler does not affect platform start up.
*/
static class Lazy {
private static final String defaultJavaCompilerName
= "com.sun.tools.javac.api.JavacTool";
private static final String[] defaultToolsLocation
= { "lib", "tools.jar" };
static {
try {
} catch (Throwable t) {
}
compilerClass = c;
}
{
try {
} catch (ClassNotFoundException e) {
}
}
try {
else
} catch (SecurityException ex) {
}
return cls;
}
}
}