|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.tools.javac.api.JavacTool
public final class JavacTool
TODO: describe com.sun.tools.javac.api.Tool
This is NOT part of any API supported by Sun Microsystems. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface javax.tools.JavaCompiler |
---|
JavaCompiler.CompilationTask |
Field Summary | |
---|---|
private boolean |
compilationInProgress
|
private Context |
dummyContext
|
private java.util.List<Pair<java.lang.String,java.lang.String>> |
options
|
private Main |
sharedCompiler
|
private java.io.PrintWriter |
silent
|
Constructor Summary | |
---|---|
JavacTool()
Deprecated. |
Method Summary | |
---|---|
private java.lang.String |
argsToString(java.lang.Object... args)
|
(package private) void |
beginContext(Context context)
Register that a compilation is about to start. |
static JavacTool |
create()
Static factory method for creating new instances of this tool. |
(package private) void |
endContext()
Register that a compilation is completed. |
java.util.Set<SourceVersion> |
getSourceVersions()
Gets the source versions of the Java™ programming language supported by this tool. |
JavacFileManager |
getStandardFileManager(DiagnosticListener<? super JavaFileObject> diagnosticListener,
java.util.Locale locale,
java.nio.charset.Charset charset)
Gets a new instance of the standard file manager implementation for this tool. |
JavacTask |
getTask(java.io.Writer out,
JavaFileManager fileManager,
DiagnosticListener<? super JavaFileObject> diagnosticListener,
java.lang.Iterable<java.lang.String> options,
java.lang.Iterable<java.lang.String> classes,
java.lang.Iterable<? extends JavaFileObject> compilationUnits)
Creates a future for a compilation task with the given components and arguments. |
int |
isSupportedOption(java.lang.String option)
Determines if the given option is supported and if so, the number of arguments the option takes. |
private static boolean |
match(JavacOption.OptionKind clientKind,
JavacOption.OptionKind optionKind)
|
private static void |
processOptions(Context context,
JavaFileManager fileManager,
java.lang.Iterable<java.lang.String> options)
|
int |
run(java.io.InputStream in,
java.io.OutputStream out,
java.io.OutputStream err,
java.lang.String... arguments)
Run the tool with the given I/O channels and arguments. |
void |
setExtendedOption(java.lang.String name,
java.lang.Object... args)
|
void |
setOption(java.lang.String name,
java.lang.Object... args)
|
private void |
setOption1(java.lang.String name,
JavacOption.OptionKind kind,
java.lang.Object... args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.util.List<Pair<java.lang.String,java.lang.String>> options
private final Context dummyContext
private final java.io.PrintWriter silent
private final Main sharedCompiler
private boolean compilationInProgress
Constructor Detail |
---|
@Deprecated public JavacTool()
javax.tools.JavaCompilerTool
,
ToolProvider
,
create()
Method Detail |
---|
public static JavacTool create()
private java.lang.String argsToString(java.lang.Object... args)
private void setOption1(java.lang.String name, JavacOption.OptionKind kind, java.lang.Object... args)
public void setOption(java.lang.String name, java.lang.Object... args)
public void setExtendedOption(java.lang.String name, java.lang.Object... args)
private static boolean match(JavacOption.OptionKind clientKind, JavacOption.OptionKind optionKind)
public JavacFileManager getStandardFileManager(DiagnosticListener<? super JavaFileObject> diagnosticListener, java.util.Locale locale, java.nio.charset.Charset charset)
JavaCompiler
The standard file manager will be automatically reopened if
it is accessed after calls to flush
or close
.
The standard file manager must be usable with other tools.
getStandardFileManager
in interface JavaCompiler
diagnosticListener
- a diagnostic listener for non-fatal
diagnostics; if null
use the compiler's default method
for reporting diagnosticslocale
- the locale to apply when formatting diagnostics;
null
means the default locale.charset
- the character set used for decoding bytes; if
null
use the platform default
void beginContext(Context context)
void endContext()
public JavacTask getTask(java.io.Writer out, JavaFileManager fileManager, DiagnosticListener<? super JavaFileObject> diagnosticListener, java.lang.Iterable<java.lang.String> options, java.lang.Iterable<java.lang.String> classes, java.lang.Iterable<? extends JavaFileObject> compilationUnits)
JavaCompiler
If a file manager is provided, it must be able to handle all
locations defined in StandardLocation
.
getTask
in interface JavaCompiler
out
- a Writer for additional output from the compiler;
use System.err
if null
fileManager
- a file manager; if null
use the
compiler's standard filemanagerdiagnosticListener
- a diagnostic listener; if null
use the compiler's default method for reporting
diagnosticsoptions
- compiler options, null
means no optionsclasses
- class names (for annotation processing), null
means no class namescompilationUnits
- the compilation units to compile, null
means no compilation units
private static void processOptions(Context context, JavaFileManager fileManager, java.lang.Iterable<java.lang.String> options)
public int run(java.io.InputStream in, java.io.OutputStream out, java.io.OutputStream err, java.lang.String... arguments)
Tool
out
or err
in some unspecified format.
run
in interface Tool
in
- "standard" input; use System.in if nullout
- "standard" output; use System.out if nullerr
- "standard" error; use System.err if nullarguments
- arguments to pass to the tool
public java.util.Set<SourceVersion> getSourceVersions()
Tool
getSourceVersions
in interface Tool
public int isSupportedOption(java.lang.String option)
OptionChecker
isSupportedOption
in interface OptionChecker
option
- an option
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |