Callable<Boolean>
, JavaCompiler.CompilationTask
public abstract class JavacTask extends Object implements JavaCompiler.CompilationTask
Constructor | Description |
---|---|
JavacTask() |
Modifier and Type | Method | Description |
---|---|---|
abstract void |
addTaskListener(TaskListener taskListener) |
Adds a specified listener so that it receives notification of events
describing the progress of this compilation task.
|
abstract Iterable<? extends Element> |
analyze() |
Completes all analysis.
|
abstract Iterable<? extends JavaFileObject> |
generate() |
Generates code.
|
abstract Elements |
getElements() |
Returns a utility object for dealing with program elements.
|
abstract TypeMirror |
getTypeMirror(Iterable<? extends Tree> path) |
Returns a type mirror of the tree node determined by the specified path.
|
abstract Types |
getTypes() |
Returns a utility object for dealing with type mirrors.
|
static JavacTask |
instance(ProcessingEnvironment processingEnvironment) |
Returns the
JavacTask for a ProcessingEnvironment . |
abstract Iterable<? extends CompilationUnitTree> |
parse() |
Parses the specified files returning a list of abstract syntax trees.
|
abstract void |
removeTaskListener(TaskListener taskListener) |
Removes the specified listener so that it no longer receives
notification of events describing the progress of this
compilation task.
|
abstract void |
setTaskListener(TaskListener taskListener) |
Sets a specified listener to receive notification of events
describing the progress of this compilation task.
|
addModules, call, setLocale, setProcessors
public static JavacTask instance(ProcessingEnvironment processingEnvironment)
JavacTask
for a ProcessingEnvironment
.
If the compiler is being invoked using a
CompilationTask
,
then that task will be returned.processingEnvironment
- the processing environmentJavacTask
for a ProcessingEnvironment
public abstract Iterable<? extends CompilationUnitTree> parse() throws IOException
IOException
- if an unhandled I/O error occurred in the compiler.IllegalStateException
- if the operation cannot be performed at this time.public abstract Iterable<? extends Element> analyze() throws IOException
IOException
- if an unhandled I/O error occurred in the compiler.IllegalStateException
- if the operation cannot be performed at this time.public abstract Iterable<? extends JavaFileObject> generate() throws IOException
IOException
- if an unhandled I/O error occurred in the compiler.IllegalStateException
- if the operation cannot be performed at this time.public abstract void setTaskListener(TaskListener taskListener)
removeTaskListener
for
any listener that has been previously set, followed by addTaskListener
for the new listener.taskListener
- the task listenerIllegalStateException
- if the specified listener has already been added.public abstract void addTaskListener(TaskListener taskListener)
taskListener
- the task listenerIllegalStateException
- if the specified listener has already been added.public abstract void removeTaskListener(TaskListener taskListener)
taskListener
- the task listenerpublic abstract TypeMirror getTypeMirror(Iterable<? extends Tree> path)
Trees
.path
- the pathTrees.getTypeMirror(com.sun.source.util.TreePath)
public abstract Elements getElements()
public abstract Types getTypes()
Submit a bug or feature
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 2005, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-Ubuntu+0-9b158-1