public class BasicJavacTask extends JavacTask
This is NOT part of any supported API. 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.
Constructor and Description |
---|
BasicJavacTask(Context c,
boolean register) |
Modifier and Type | Method and Description |
---|---|
void |
addTaskListener(TaskListener taskListener)
The specified listener will receive notification of events
describing the progress of this compilation task.
|
Iterable<? extends Element> |
analyze()
Complete all analysis.
|
Boolean |
call()
Performs this compilation task.
|
Iterable<? extends JavaFileObject> |
generate()
Generate code.
|
Context |
getContext()
For internal use only.
|
Elements |
getElements()
Get a utility object for dealing with program elements.
|
Collection<TaskListener> |
getTaskListeners() |
TypeMirror |
getTypeMirror(Iterable<? extends Tree> path)
Get a type mirror of the tree node determined by the specified path.
|
Types |
getTypes()
Get a utility object for dealing with type mirrors.
|
static JavacTask |
instance(Context context) |
Iterable<? extends CompilationUnitTree> |
parse()
Parse the specified files returning a list of abstract syntax trees.
|
void |
removeTaskListener(TaskListener taskListener)
The specified listener will no longer receive notification of events
describing the progress of this compilation task.
|
void |
setLocale(Locale locale)
Set the locale to be applied when formatting diagnostics and
other localized data.
|
void |
setProcessors(Iterable<? extends Processor> processors)
Sets processors (for annotation processing).
|
void |
setTaskListener(TaskListener tl)
The specified listener will receive notification of events
describing the progress of this compilation task.
|
void |
updateContext(Context newContext)
For internal use only.
|
protected Context context
public BasicJavacTask(Context c, boolean register)
public Iterable<? extends CompilationUnitTree> parse() throws IOException
JavacTask
parse
in class JavacTask
IOException
- if an unhandled I/O error occurred in the compiler.public Iterable<? extends Element> analyze() throws IOException
JavacTask
analyze
in class JavacTask
IOException
- if an unhandled I/O error occurred in the compiler.public Iterable<? extends JavaFileObject> generate() throws IOException
JavacTask
generate
in class JavacTask
IOException
- if an unhandled I/O error occurred in the compiler.public void setTaskListener(TaskListener tl)
JavacTask
removeTaskListener
for
any listener that has been previously set, followed by addTaskListener
for the new listener.setTaskListener
in class JavacTask
public void addTaskListener(TaskListener taskListener)
JavacTask
addTaskListener
in class JavacTask
public void removeTaskListener(TaskListener taskListener)
JavacTask
removeTaskListener
in class JavacTask
public Collection<TaskListener> getTaskListeners()
public TypeMirror getTypeMirror(Iterable<? extends Tree> path)
JavacTask
Trees
.getTypeMirror
in class JavacTask
Trees.getTypeMirror(com.sun.source.util.TreePath)
public Elements getElements()
JavacTask
getElements
in class JavacTask
public Types getTypes()
JavacTask
public void setProcessors(Iterable<? extends Processor> processors)
JavaCompiler.CompilationTask
processors
- processors (for annotation processing)public void setLocale(Locale locale)
JavaCompiler.CompilationTask
locale
- the locale to apply; null
means apply no
localepublic Boolean call()
JavaCompiler.CompilationTask
public Context getContext()
public void updateContext(Context newContext)
Copyright © 2016. All rights reserved.