com.sun.javafx.api
Interface JavafxCompiler

All Superinterfaces:
javax.tools.OptionChecker, javax.tools.Tool

public interface JavafxCompiler
extends javax.tools.Tool, javax.tools.OptionChecker

The interface to invoke JavaFX Script compilers from programs, used with ServiceLoader lookup. This interface is based on the JavaCompiler interface; see its documentation for detailed descriptions.

See Also:
JavaCompiler

Nested Class Summary
static interface JavafxCompiler.CompilationTask
          Interface representing a future for a compilation task.
 
Method Summary
 javax.tools.StandardJavaFileManager getStandardFileManager(javax.tools.DiagnosticListener<? super javax.tools.JavaFileObject> diagnosticListener, java.util.Locale locale, java.nio.charset.Charset charset)
          Gets a new instance of the standard file manager implementation for this tool.
 JavafxcTask getTask(java.io.Writer out, javax.tools.JavaFileManager fileManager, javax.tools.DiagnosticListener<? super javax.tools.JavaFileObject> diagnosticListener, java.lang.Iterable<java.lang.String> options, java.lang.Iterable<? extends javax.tools.JavaFileObject> compilationUnits)
          Creates a future for a compilation task with the given components and arguments.
 
Methods inherited from interface javax.tools.Tool
getSourceVersions, run
 
Methods inherited from interface javax.tools.OptionChecker
isSupportedOption
 

Method Detail

getTask

JavafxcTask getTask(java.io.Writer out,
                    javax.tools.JavaFileManager fileManager,
                    javax.tools.DiagnosticListener<? super javax.tools.JavaFileObject> diagnosticListener,
                    java.lang.Iterable<java.lang.String> options,
                    java.lang.Iterable<? extends javax.tools.JavaFileObject> compilationUnits)
Creates a future for a compilation task with the given components and arguments. The compilation might not have completed as described in the CompilationTask interface.

If a file manager is provided, it must be able to handle all locations defined in StandardLocation.

Parameters:
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 filemanager
diagnosticListener - a diagnostic listener; if null use the compiler's default method for reporting diagnostics
options - compiler options, null means no options
compilationUnits - the compilation units to compile, null means no compilation units
Returns:
an object representing the compilation
Throws:
java.lang.RuntimeException - if an unrecoverable error occurred in a user supplied component. The cause will be the error in user code.
java.lang.IllegalArgumentException - if any of the given compilation units are of other kind than source

getStandardFileManager

javax.tools.StandardJavaFileManager getStandardFileManager(javax.tools.DiagnosticListener<? super javax.tools.JavaFileObject> diagnosticListener,
                                                           java.util.Locale locale,
                                                           java.nio.charset.Charset charset)
Gets a new instance of the standard file manager implementation for this tool. The file manager will use the given diagnostic listener for producing any non-fatal diagnostics. Fatal errors will be signalled with the appropriate exceptions.

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.

Parameters:
diagnosticListener - a diagnostic listener for non-fatal diagnostics; if null use the compiler's default method for reporting diagnostics
locale - 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
Returns:
the standard file manager