public class JavacTaskImpl extends BasicJavacTask
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.
context
Modifier and Type | Method and Description |
---|---|
Iterable<? extends Element> |
analyze()
Complete all analysis.
|
Iterable<? extends Element> |
analyze(Iterable<? extends TypeElement> classes)
Complete all analysis on the given classes.
|
JavaFileObject |
asJavaFileObject(File file)
Construct a JavaFileObject from the given file.
|
Boolean |
call()
Performs this compilation task.
|
Main.Result |
doCall() |
Iterable<? extends TypeElement> |
enter()
Translate all the abstract syntax trees to elements.
|
Iterable<? extends TypeElement> |
enter(Iterable<? extends CompilationUnitTree> trees)
Translate the given abstract syntax trees to elements.
|
Iterable<? extends JavaFileObject> |
generate()
Generate code.
|
Iterable<? extends JavaFileObject> |
generate(Iterable<? extends TypeElement> classes)
Generate code corresponding to the given classes.
|
JavacElements |
getElements()
Get a utility object for dealing with program elements.
|
TypeMirror |
getTypeMirror(Iterable<? extends Tree> path)
Get a type mirror of the tree node determined by the specified path.
|
JavacTypes |
getTypes()
Get a utility object for dealing with type mirrors.
|
Iterable<? extends CompilationUnitTree> |
parse()
Parse the specified files returning a list of abstract syntax trees.
|
Type |
parseType(String expr,
TypeElement scope)
For internal use only.
|
Iterable<? extends Tree> |
pathFor(CompilationUnitTree unit,
Tree node) |
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).
|
addTaskListener, getContext, getTaskListeners, instance, removeTaskListener, setTaskListener, updateContext
public Main.Result doCall()
public Boolean call()
JavaCompiler.CompilationTask
call
in interface Callable<Boolean>
call
in interface JavaCompiler.CompilationTask
call
in class BasicJavacTask
public void setProcessors(Iterable<? extends Processor> processors)
JavaCompiler.CompilationTask
setProcessors
in interface JavaCompiler.CompilationTask
setProcessors
in class BasicJavacTask
processors
- processors (for annotation processing)public void setLocale(Locale locale)
JavaCompiler.CompilationTask
setLocale
in interface JavaCompiler.CompilationTask
setLocale
in class BasicJavacTask
locale
- the locale to apply; null
means apply no
localepublic JavaFileObject asJavaFileObject(File file)
TODO: this method is useless here
file
- a filepublic Iterable<? extends CompilationUnitTree> parse() throws IOException
parse
in class BasicJavacTask
IOException
- TODOpublic Iterable<? extends TypeElement> enter() throws IOException
IOException
- TODOpublic Iterable<? extends TypeElement> enter(Iterable<? extends CompilationUnitTree> trees) throws IOException
trees
- a list of abstract syntax trees.IOException
- TODOpublic Iterable<? extends Element> analyze() throws IOException
analyze
in class BasicJavacTask
IOException
- TODOpublic Iterable<? extends Element> analyze(Iterable<? extends TypeElement> classes) throws IOException
enter()
.
If null is specified, all outstanding classes will be analyzed.classes
- a list of class elementsIOException
public Iterable<? extends JavaFileObject> generate() throws IOException
generate
in class BasicJavacTask
IOException
- TODOpublic Iterable<? extends JavaFileObject> generate(Iterable<? extends TypeElement> classes) throws IOException
enter()
.
If there are classes outstanding to be analyzed, that will be done before
any classes are generated.
If null is specified, code will be generated for all outstanding classes.classes
- a list of class elementsIOException
public TypeMirror getTypeMirror(Iterable<? extends Tree> path)
JavacTask
Trees
.getTypeMirror
in class BasicJavacTask
Trees.getTypeMirror(com.sun.source.util.TreePath)
public JavacElements getElements()
JavacTask
getElements
in class BasicJavacTask
public JavacTypes getTypes()
JavacTask
getTypes
in class BasicJavacTask
public Iterable<? extends Tree> pathFor(CompilationUnitTree unit, Tree node)
public Type parseType(String expr, TypeElement scope)
Copyright © 2015. All rights reserved.