@Exported public abstract class JavacTask extends Object implements JavaCompiler.CompilationTask
Constructor and Description |
---|
JavacTask() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addTaskListener(TaskListener taskListener)
The specified listener will receive notification of events
describing the progress of this compilation task.
|
abstract Iterable<? extends Element> |
analyze()
Complete all analysis.
|
abstract Iterable<? extends JavaFileObject> |
generate()
Generate code.
|
abstract Elements |
getElements()
Get a utility object for dealing with program elements.
|
abstract TypeMirror |
getTypeMirror(Iterable<? extends Tree> path)
Get a type mirror of the tree node determined by the specified path.
|
abstract Types |
getTypes()
Get a utility object for dealing with type mirrors.
|
static JavacTask |
instance(ProcessingEnvironment processingEnvironment)
Get the
JavacTask for a ProcessingEnvironment . |
abstract Iterable<? extends CompilationUnitTree> |
parse()
Parse the specified files returning a list of abstract syntax trees.
|
abstract void |
removeTaskListener(TaskListener taskListener)
The specified listener will no longer receive notification of events
describing the progress of this compilation task.
|
abstract void |
setTaskListener(TaskListener taskListener)
The specified listener will receive notification of events
describing the progress of this compilation task.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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.IllegalStateException
- if the specified listener has already been added.public abstract void addTaskListener(TaskListener taskListener)
IllegalStateException
- if the specified listener has already been added.public abstract void removeTaskListener(TaskListener taskListener)
public abstract TypeMirror getTypeMirror(Iterable<? extends Tree> path)
Trees
.public abstract Elements getElements()
public abstract Types getTypes()
Copyright © 2005, 2016, Oracle and/or its affiliates. All rights reserved.