Compiler Tree API

com.sun.source.util
クラス TreePath

java.lang.Object
  上位を拡張 com.sun.source.util.TreePath
すべての実装されたインタフェース:
Iterable<Tree>

public class TreePath
extends Object
implements Iterable<Tree>

ツリーノードのパスです。通常、トップレベルの CompilationUnitTree ノードまでの、ツリーノードの上位ノードのシーケンスを表すために使用されます。

導入されたバージョン:
1.6

コンストラクタの概要
TreePath(CompilationUnitTree t)
          ルートノードの TreePath を作成します。
TreePath(TreePath p, Tree t)
          子ノードの TreePath を作成します。
 
メソッドの概要
 CompilationUnitTree getCompilationUnit()
          このパスに関連付けられたコンパイルユニットを取得します。
 Tree getLeaf()
          このパスの葉ノードを取得します。
 TreePath getParentPath()
          包含するノードのパスを取得します。
static TreePath getPath(CompilationUnitTree unit, Tree target)
          コンパイルユニット内のツリーノードのツリーパスを取得します。
static TreePath getPath(TreePath path, Tree target)
          TreePath オブジェクトによって識別されるサブツリー内のツリーノードのツリーパスを取得します。
 Iterator<Tree> iterator()
          Returns an iterator over a set of elements of type T.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

TreePath

public TreePath(CompilationUnitTree t)
ルートノードの TreePath を作成します。


TreePath

public TreePath(TreePath p,
                Tree t)
子ノードの TreePath を作成します。

メソッドの詳細

getPath

public static TreePath getPath(CompilationUnitTree unit,
                               Tree target)
コンパイルユニット内のツリーノードのツリーパスを取得します。

戻り値:
ノードが見つからない場合は null

getPath

public static TreePath getPath(TreePath path,
                               Tree target)
TreePath オブジェクトによって識別されるサブツリー内のツリーノードのツリーパスを取得します。

戻り値:
ノードが見つからない場合は null

getCompilationUnit

public CompilationUnitTree getCompilationUnit()
このパスに関連付けられたコンパイルユニットを取得します。


getLeaf

public Tree getLeaf()
このパスの葉ノードを取得します。


getParentPath

public TreePath getParentPath()
包含するノードのパスを取得します。包含するノードがない場合は、null を返します。


iterator

public Iterator<Tree> iterator()
インタフェース java.lang.Iterable の記述:
Returns an iterator over a set of elements of type T.

定義:
インタフェース Iterable<Tree> 内の iterator
戻り値:
an Iterator.

Compiler Tree API

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