Compiler Tree API

com.sun.source.util
クラス Trees

java.lang.Object
  上位を拡張 com.sun.source.util.Trees

public abstract class Trees
extends Object

JSR 199、JSR 269、および Tree API をブリッジします。


コンストラクタの概要
Trees()
           
 
メソッドの概要
abstract  Element getElement(TreePath path)
          指定された TreePath によって識別される Tree ノードの Element を取得します。
abstract  TreePath getPath(CompilationUnitTree unit, Tree node)
          指定されたコンパイルユニット内のツリーノードへのパスを取得します。
abstract  TreePath getPath(Element e)
          指定された Element の TreePath ノードを取得します。
abstract  TreePath getPath(Element e, AnnotationMirror a)
          指定された Element 上の AnnotationMirror の TreePath ノードを取得します。
abstract  TreePath getPath(Element e, AnnotationMirror a, AnnotationValue v)
          指定された Element 上の AnnotationMirror の AnnotationValue の TreePath ノードを取得します。
abstract  Scope getScope(TreePath path)
          指定された TreePath によって識別される Tree ノードの Scope を取得します。
abstract  SourcePositions getSourcePositions()
          ソース位置を取得するためのユーティリティーオブジェクトを取得します。
abstract  Tree getTree(Element element)
          指定された Element の Tree ノードを取得します。
abstract  Tree getTree(Element e, AnnotationMirror a)
          指定された Element 上の AnnotationMirror の Tree ノードを取得します。
abstract  Tree getTree(Element e, AnnotationMirror a, AnnotationValue v)
          指定された Element 上の AnnotationMirror の AnnotationValue の Tree ノードを取得します。
abstract  MethodTree getTree(ExecutableElement method)
          指定された ExecutableElement の MethodTree ノードを取得します。
abstract  ClassTree getTree(TypeElement element)
          指定された TypeElement の ClassTree ノードを取得します。
abstract  TypeMirror getTypeMirror(TreePath path)
          指定された TreePath によって識別される Tree ノードの TypeMirror を取得します。
static Trees instance(JavaCompiler.CompilationTask task)
          指定された CompilationTask の Trees オブジェクトを取得します。
static Trees instance(ProcessingEnvironment env)
          指定された CompilationTask の Trees オブジェクトを取得します。
abstract  boolean isAccessible(Scope scope, Element member, DeclaredType type)
          指定されたスコープ内で、指定された要素が、指定された型のメンバーとしてアクセス可能であるかどうかを判定します。
abstract  boolean isAccessible(Scope scope, TypeElement type)
          指定されたスコープ内で、指定された型にアクセス可能であるかどうかを判定します。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

Trees

public Trees()
メソッドの詳細

instance

public static Trees instance(JavaCompiler.CompilationTask task)
指定された CompilationTask の Trees オブジェクトを取得します。

例外:
IllegalArgumentException - タスクが Trees API をサポートしていない場合

instance

public static Trees instance(ProcessingEnvironment env)
指定された CompilationTask の Trees オブジェクトを取得します。

例外:
IllegalArgumentException - env が Trees API をサポートしていない場合

getSourcePositions

public abstract SourcePositions getSourcePositions()
ソース位置を取得するためのユーティリティーオブジェクトを取得します。


getTree

public abstract Tree getTree(Element element)
指定された Element の Tree ノードを取得します。ノードが見つからない場合は null を返します。


getTree

public abstract ClassTree getTree(TypeElement element)
指定された TypeElement の ClassTree ノードを取得します。ノードが見つからない場合は null を返します。


getTree

public abstract MethodTree getTree(ExecutableElement method)
指定された ExecutableElement の MethodTree ノードを取得します。ノードが見つからない場合は null を返します。


getTree

public abstract Tree getTree(Element e,
                             AnnotationMirror a)
指定された Element 上の AnnotationMirror の Tree ノードを取得します。ノードが見つからない場合は null を返します。


getTree

public abstract Tree getTree(Element e,
                             AnnotationMirror a,
                             AnnotationValue v)
指定された Element 上の AnnotationMirror の AnnotationValue の Tree ノードを取得します。ノードが見つからない場合は null を返します。


getPath

public abstract TreePath getPath(CompilationUnitTree unit,
                                 Tree node)
指定されたコンパイルユニット内のツリーノードへのパスを取得します。


getPath

public abstract TreePath getPath(Element e)
指定された Element の TreePath ノードを取得します。ノードが見つからない場合は null を返します。


getPath

public abstract TreePath getPath(Element e,
                                 AnnotationMirror a)
指定された Element 上の AnnotationMirror の TreePath ノードを取得します。ノードが見つからない場合は null を返します。


getPath

public abstract TreePath getPath(Element e,
                                 AnnotationMirror a,
                                 AnnotationValue v)
指定された Element 上の AnnotationMirror の AnnotationValue の TreePath ノードを取得します。ノードが見つからない場合は null を返します。


getElement

public abstract Element getElement(TreePath path)
指定された TreePath によって識別される Tree ノードの Element を取得します。要素が無効な場合は null を返します。

例外:
IllegalArgumentException - TreePath が、関連付けられた Element を持つ可能性がある Tree ノードを識別しない場合

getTypeMirror

public abstract TypeMirror getTypeMirror(TreePath path)
指定された TreePath によって識別される Tree ノードの TypeMirror を取得します。TypeMirror が無効な場合は null を返します。

例外:
IllegalArgumentException - TreePath が、関連付けられた TypeMirror を持つ可能性がある Tree ノードを識別しない場合

getScope

public abstract Scope getScope(TreePath path)
指定された TreePath によって識別される Tree ノードの Scope を取得します。Scope が無効な場合は null を返します。


isAccessible

public abstract boolean isAccessible(Scope scope,
                                     TypeElement type)
指定されたスコープ内で、指定された型にアクセス可能であるかどうかを判定します。

パラメータ:
scope - チェック対象のスコープ
type - チェック対象の型
戻り値:
type がアクセス可能な場合は true

isAccessible

public abstract boolean isAccessible(Scope scope,
                                     Element member,
                                     DeclaredType type)
指定されたスコープ内で、指定された要素が、指定された型のメンバーとしてアクセス可能であるかどうかを判定します。

パラメータ:
scope - チェック対象のスコープ
member - チェック対象のメンバー
type - メンバーがアクセス可能かどうかを判定する型
戻り値:
typemember がアクセス可能な場合は true

Compiler Tree API

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