|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.source.util.JavacTask
com.sun.tools.javac.api.JavacTaskImpl
public class JavacTaskImpl
Provides access to functionality specific to the Sun Java Compiler, javac.
This is NOT part of any API supported by Sun Microsystems. 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.
| Nested Class Summary | |
|---|---|
(package private) class |
JavacTaskImpl.Filter
|
| Field Summary | |
|---|---|
private java.lang.String[] |
args
|
private JavaCompiler |
compiler
|
private Main |
compilerMain
|
private Context |
context
|
private List<JavaFileObject> |
fileObjects
|
private ListBuffer<Env<AttrContext>> |
genList
|
private java.util.Locale |
locale
|
private java.util.Map<JavaFileObject,JCTree.JCCompilationUnit> |
notYetEntered
|
private boolean |
parsed
|
private java.lang.Iterable<? extends Processor> |
processors
|
private java.lang.Integer |
result
|
private TaskListener |
taskListener
|
private JavacTool |
tool
|
private java.util.concurrent.atomic.AtomicBoolean |
used
|
| Constructor Summary | |
|---|---|
JavacTaskImpl(JavacTool tool,
Main compilerMain,
java.lang.Iterable<java.lang.String> flags,
Context context,
java.lang.Iterable<java.lang.String> classes,
java.lang.Iterable<? extends JavaFileObject> fileObjects)
|
|
JavacTaskImpl(JavacTool tool,
Main compilerMain,
java.lang.String[] args,
Context context,
List<JavaFileObject> fileObjects)
|
|
| Method Summary | |
|---|---|
java.lang.Iterable<? extends Element> |
analyze()
Complete all analysis. |
java.lang.Iterable<? extends Element> |
analyze(java.lang.Iterable<? extends TypeElement> classes)
Complete all analysis on the given classes. |
JavaFileObject |
asJavaFileObject(java.io.File file)
Construct a JavaFileObject from the given file. |
private void |
beginContext()
|
java.lang.Boolean |
call()
Performs this compilation task. |
private void |
endContext()
|
java.lang.Iterable<? extends TypeElement> |
enter()
Translate all the abstract syntax trees to elements. |
java.lang.Iterable<? extends TypeElement> |
enter(java.lang.Iterable<? extends CompilationUnitTree> trees)
Translate the given abstract syntax trees to elements. |
java.lang.Iterable<? extends JavaFileObject> |
generate()
Generate code. |
java.lang.Iterable<? extends JavaFileObject> |
generate(java.lang.Iterable<? extends TypeElement> classes)
Generate code corresponding to the given classes. |
Context |
getContext()
For internal use by Sun Microsystems only. |
JavacElements |
getElements()
Get a utility object for dealing with program elements. |
TypeMirror |
getTypeMirror(java.lang.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. |
private void |
handleFlowResults(java.util.Queue<Env<AttrContext>> queue,
ListBuffer<Element> elems)
|
java.lang.Iterable<? extends CompilationUnitTree> |
parse()
Parse the specified files returning a list of abstract syntax trees. |
Type |
parseType(java.lang.String expr,
TypeElement scope)
For internal use by Sun Microsystems only. |
java.lang.Iterable<? extends Tree> |
pathFor(CompilationUnitTree unit,
Tree node)
|
private void |
prepareCompiler()
|
void |
setLocale(java.util.Locale locale)
Set the locale to be applied when formatting diagnostics and other localized data. |
void |
setProcessors(java.lang.Iterable<? extends Processor> processors)
Sets processors (for annotation processing). |
void |
setTaskListener(TaskListener taskListener)
The specified listener will receive events describing the progress of this compilation task. |
private static java.lang.String[] |
toArray(java.lang.Iterable<java.lang.String> flags,
java.lang.Iterable<java.lang.String> classes)
|
private static List<JavaFileObject> |
toList(java.lang.Iterable<? extends JavaFileObject> fileObjects)
|
void |
updateContext(Context newContext)
For internal use by Sun Microsystems only. |
private TaskListener |
wrap(TaskListener tl)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private JavacTool tool
private Main compilerMain
private JavaCompiler compiler
private java.util.Locale locale
private java.lang.String[] args
private Context context
private List<JavaFileObject> fileObjects
private java.util.Map<JavaFileObject,JCTree.JCCompilationUnit> notYetEntered
private ListBuffer<Env<AttrContext>> genList
private TaskListener taskListener
private java.util.concurrent.atomic.AtomicBoolean used
private java.lang.Iterable<? extends Processor> processors
private java.lang.Integer result
private boolean parsed
| Constructor Detail |
|---|
JavacTaskImpl(JavacTool tool,
Main compilerMain,
java.lang.String[] args,
Context context,
List<JavaFileObject> fileObjects)
JavacTaskImpl(JavacTool tool,
Main compilerMain,
java.lang.Iterable<java.lang.String> flags,
Context context,
java.lang.Iterable<java.lang.String> classes,
java.lang.Iterable<? extends JavaFileObject> fileObjects)
| Method Detail |
|---|
private static java.lang.String[] toArray(java.lang.Iterable<java.lang.String> flags,
java.lang.Iterable<java.lang.String> classes)
private static List<JavaFileObject> toList(java.lang.Iterable<? extends JavaFileObject> fileObjects)
public java.lang.Boolean call()
JavaCompiler.CompilationTask
public void setProcessors(java.lang.Iterable<? extends Processor> processors)
JavaCompiler.CompilationTask
processors - processors (for annotation processing)public void setLocale(java.util.Locale locale)
JavaCompiler.CompilationTask
locale - the locale to apply; null means apply no
locale
private void prepareCompiler()
throws java.io.IOException
java.io.IOExceptionprivate void beginContext()
private TaskListener wrap(TaskListener tl)
private void endContext()
public JavaFileObject asJavaFileObject(java.io.File file)
TODO: this method is useless here
file - a file
public void setTaskListener(TaskListener taskListener)
JavacTask
setTaskListener in class JavacTask
public java.lang.Iterable<? extends CompilationUnitTree> parse()
throws java.io.IOException
parse in class JavacTaskjava.io.IOException - TODO
public java.lang.Iterable<? extends TypeElement> enter()
throws java.io.IOException
java.io.IOException - TODO
public java.lang.Iterable<? extends TypeElement> enter(java.lang.Iterable<? extends CompilationUnitTree> trees)
throws java.io.IOException
trees - a list of abstract syntax trees.
java.io.IOException - TODO
public java.lang.Iterable<? extends Element> analyze()
throws java.io.IOException
analyze in class JavacTaskjava.io.IOException - TODO
public java.lang.Iterable<? extends Element> analyze(java.lang.Iterable<? extends TypeElement> classes)
throws java.io.IOException
enter().
If null is specified, all outstanding classes will be analyzed.
classes - a list of class elements
java.io.IOException
private void handleFlowResults(java.util.Queue<Env<AttrContext>> queue,
ListBuffer<Element> elems)
public java.lang.Iterable<? extends JavaFileObject> generate()
throws java.io.IOException
generate in class JavacTaskjava.io.IOException - TODO
public java.lang.Iterable<? extends JavaFileObject> generate(java.lang.Iterable<? extends TypeElement> classes)
throws java.io.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 elements
java.io.IOExceptionpublic TypeMirror getTypeMirror(java.lang.Iterable<? extends Tree> path)
JavacTask
getTypeMirror in class JavacTaskpublic JavacElements getElements()
JavacTask
getElements in class JavacTaskpublic JavacTypes getTypes()
JavacTask
getTypes in class JavacTask
public java.lang.Iterable<? extends Tree> pathFor(CompilationUnitTree unit,
Tree node)
public Context getContext()
public void updateContext(Context newContext)
public Type parseType(java.lang.String expr,
TypeElement scope)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||