站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v6.0, Java 2 SDK 英文文档

JavacTask (Compiler Tree API) - JDK 5 Documentation v6.0, Java 2 SDK 英文文档


Compiler Tree API

com.sun.source.util
Class JavacTask

java.lang.Object
  extended by com.sun.source.util.JavacTask
All Implemented Interfaces:
Callable<Boolean>, JavaCompiler.CompilationTask

public abstract class JavacTask
extends Object
implements JavaCompiler.CompilationTask

Provides access to functionality specific to the Sun Java Compiler, javac.

Since:
1.6

Constructor Summary
JavacTask()
           
 
Method Summary
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.
abstract  Iterable<? extends CompilationUnitTree> parse()
          Parse the specified files returning a list of abstract syntax trees.
abstract  void setTaskListener(TaskListener taskListener)
          The specified listener will receive events describing the progress of this compilation task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.tools.JavaCompiler.CompilationTask
call, setLocale, setProcessors
 

Constructor Detail

JavacTask

public JavacTask()
Method Detail

parse

public abstract Iterable<? extends CompilationUnitTree> parse()
                                                       throws IOException
Parse the specified files returning a list of abstract syntax trees.

Returns:
a list of abstract syntax trees
Throws:
IOException - if an unhandled I/O error occurred in the compiler.

analyze

public abstract Iterable<? extends Element> analyze()
                                             throws IOException
Complete all analysis.

Returns:
a list of elements that were analyzed
Throws:
IOException - if an unhandled I/O error occurred in the compiler.

generate

public abstract Iterable<? extends JavaFileObject> generate()
                                                     throws IOException
Generate code.

Returns:
a list of files that were generated
Throws:
IOException - if an unhandled I/O error occurred in the compiler.

setTaskListener

public abstract void setTaskListener(TaskListener taskListener)
The specified listener will receive events describing the progress of this compilation task.


getTypeMirror

public abstract TypeMirror getTypeMirror(Iterable<? extends Tree> path)
Get a type mirror of the tree node determined by the specified path.


getElements

public abstract Elements getElements()
Get a utility object for dealing with program elements.


getTypes

public abstract Types getTypes()
Get a utility object for dealing with type mirrors.


Compiler Tree API

Report a bug or request a feature.
Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.