java.lang.Object
com.sun.source.util.Trees
- 直系の既知のサブクラス:
DocTrees
public abstract class Trees extends Object
JSR 199、JSR 269、およびTree APIをブリッジします。
-
コンストラクタのサマリー
コンストラクタ -
メソッドのサマリー
修飾子と型メソッド説明abstract String
getDocComment
(TreePath path) 指定されたTreePath
で識別されるTree
ノードのdocコメント(ある場合)を返します。abstract Element
getElement
(TreePath path) 指定されたTreePath
で識別されるTree
ノードのElement
を返します。abstract TypeMirror
catch句で宣言された例外パラメータのlubを返します。abstract TypeMirror
getOriginalType
(ErrorType errorType) ErrorType
オブジェクトから元のタイプを返します。abstract TreePath
getPath
(CompilationUnitTree unit, Tree node) 指定されたコンパイル単位内のツリー・ノードへのパスを返します。abstract TreePath
指定された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
指定されたTreePath
で識別されるTree
ノードのScope
を返します。abstract SourcePositions
ソース位置を取得するためのユーティリティ・オブジェクトを返します。abstract Tree
指定された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
指定されたProcessingEnvironment
のTrees
オブジェクトを返します。static Trees
指定されたCompilationTask
のTrees
オブジェクトを返します。abstract boolean
isAccessible
(Scope scope, Element member, DeclaredType type) 指定されたスコープ内で、指定された要素が、指定された型のメンバーとしてアクセス可能であるかどうかを判定します。abstract boolean
isAccessible
(Scope scope, TypeElement type) 指定されたスコープ内で、指定された型にアクセス可能であるかどうかを判定します。abstract void
printMessage
(Diagnostic.Kind kind, CharSequence msg, Tree t, CompilationUnitTree root) 指定されたコンパイル単位内のツリーの位置に、指定された種類のメッセージを出力します
-
コンストラクタの詳細
-
Trees
public Trees()サブクラスが呼び出すためのコンストラクタ。
-
-
メソッドの詳細
-
instance
public static Trees instance(JavaCompiler.CompilationTask task) 指定されたCompilationTask
のTrees
オブジェクトを返します。- パラメータ:
task
-Trees
オブジェクトを取得するコンパイル・タスク- 戻り値:
Trees
オブジェクト- 例外:
IllegalArgumentException
- タスクがツリーAPIをサポートしていない場合。
-
instance
public static Trees instance(ProcessingEnvironment env) 指定されたProcessingEnvironment
のTrees
オブジェクトを返します。- パラメータ:
env
-Trees
オブジェクトを取得する処理環境- 戻り値:
Trees
オブジェクト- 例外:
IllegalArgumentException
- 環境がツリーAPIをサポートしていない場合。
-
getSourcePositions
public abstract SourcePositions getSourcePositions()ソース位置を取得するためのユーティリティ・オブジェクトを返します。- 戻り値:
- ソース位置を取得するためのユーティリティ・オブジェクト
-
getTree
指定されたElement
のTree
ノードを返します。 ノードが見つからない場合はnull
を返します。- パラメータ:
element
- 要素- 戻り値:
- ツリー・ノード
-
getTree
public abstract ClassTree getTree(TypeElement element) 指定されたTypeElement
のClassTree
ノードを返します。 ノードが見つからない場合はnull
を返します。- パラメータ:
element
- 要素- 戻り値:
- クラス・ツリー・ノード
-
getTree
public abstract MethodTree getTree(ExecutableElement method) 指定されたExecutableElement
のMethodTree
ノードを返します。 ノードが見つからない場合はnull
を返します。- パラメータ:
method
- 実行可能要素- 戻り値:
- メソッド・ツリー・ノード
-
getTree
public abstract Tree getTree(Element e, AnnotationMirror a) 指定されたElement
のAnnotationMirror
のTree
ノードを返します。 ノードが見つからない場合はnull
を返します。- パラメータ:
e
- 要素a
- 注釈ミラー- 戻り値:
- ツリー・ノード
-
getTree
public abstract Tree getTree(Element e, AnnotationMirror a, AnnotationValue v) 指定されたElement
のAnnotationMirror
のAnnotationValue
のTree
ノードを返します。 ノードが見つからない場合はnull
を返します。- パラメータ:
e
- 要素a
- 注釈ミラーv
- 注釈値- 戻り値:
- ツリー・ノード
-
getPath
public abstract TreePath getPath(CompilationUnitTree unit, Tree node) 指定されたコンパイル単位内のツリー・ノードへのパスを返します。- パラメータ:
unit
- コンパイル単位node
- ツリー・ノード- 戻り値:
- ツリー・パス
-
getPath
指定されたElement
のTreePath
ノードを返します。 ノードが見つからない場合はnull
を返します。- パラメータ:
e
- 要素- 戻り値:
- ツリー・パス
-
getPath
public abstract TreePath getPath(Element e, AnnotationMirror a) 指定されたElement
のAnnotationMirror
のTreePath
ノードを返します。 ノードが見つからない場合はnull
を返します。- パラメータ:
e
- 要素a
- 注釈ミラー- 戻り値:
- ツリー・パス
-
getPath
public abstract TreePath getPath(Element e, AnnotationMirror a, AnnotationValue v) 指定されたElement
のAnnotationMirror
のAnnotationValue
のTreePath
ノードを返します。 ノードが見つからない場合はnull
を返します。- パラメータ:
e
- 要素a
- 注釈ミラーv
- 注釈値- 戻り値:
- ツリー・パス
-
getElement
指定されたTreePath
で識別されるTree
ノードのElement
を返します。 要素が利用できない場合は、null
を返します。- パラメータ:
path
- ツリー・パス- 戻り値:
- 要素
- 例外:
IllegalArgumentException
-TreePath
は、Element
が関連付けられている可能性のあるTree
ノードを識別しません。
-
getTypeMirror
public abstract TypeMirror getTypeMirror(TreePath path) 指定されたTreePath
で識別されるTree
ノードのTypeMirror
を返します。TypeMirror
が使用できない場合、null
を返します。- パラメータ:
path
- ツリー・パス- 戻り値:
- 型ミラー
- 例外:
IllegalArgumentException
-TreePath
は、TypeMirror
が関連付けられている可能性のあるTree
ノードを識別しません。
-
getScope
指定されたTreePath
で識別されるTree
ノードのScope
を返します。Scope
が使用できない場合、null
を返します。- パラメータ:
path
- ツリー・パス- 戻り値:
- スコープ
-
getDocComment
指定されたTreePath
で識別されるTree
ノードのdocコメント(ある場合)を返します。 ドキュメンテーション・コメントが見つからない場合は、null
を返します。- パラメータ:
path
- ツリー・パス- 戻り値:
- ドキュメンテーションのコメント
- 関連項目:
-
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
- メンバーがアクセス可能かどうかを判定する型- 戻り値:
type
のmember
がアクセス可能な場合はtrue
-
getOriginalType
public abstract TypeMirror getOriginalType(ErrorType errorType) ErrorType
オブジェクトから元のタイプを返します。- パラメータ:
errorType
- 元の型を取得するerrorType- 戻り値:
- 元のタイプに対応するタイプ・ミラー(
ErrorType
で置換)
-
printMessage
public abstract void printMessage(Diagnostic.Kind kind, CharSequence msg, Tree t, CompilationUnitTree root) 指定されたコンパイル単位内のツリーの位置に、指定された種類のメッセージを出力します- パラメータ:
kind
- メッセージの種類msg
- メッセージ、ない場合は空の文字列t
- 位置のヒントとして使用するツリーroot
- ツリーを格納するコンパイル・ユニット
-
getLub
public abstract TypeMirror getLub(CatchTree tree) catch句で宣言された例外パラメータのlubを返します。- パラメータ:
tree
- catch節のツリー- 戻り値:
- 例外パラメータのlub
-