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
- タスクがTrees APIをサポートしていない場合。
-
instance
public static Trees instance(ProcessingEnvironment env)指定されたProcessingEnvironmentのTreesオブジェクトを返します。- パラメータ:
env
- Treesオブジェクトを取得する処理環境- 戻り値:
- Treesオブジェクト
- 例外:
IllegalArgumentException
- envがTrees 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を返します。 スコープが利用できない場合は、null
を返します。- パラメータ:
path
- ツリー・パス- 戻り値:
- スコープ
-
getDocComment
指定されたTreePathによって識別されるTreeノードのdocコメントがあれば、それを返します。 ドキュメンテーション・コメントが見つからない場合は、null
を返します。- パラメータ:
path
- ツリー・パス- 戻り値:
- ドキュメンテーションのコメント
- 関連項目:
DocTrees.getDocCommentTree(TreePath)
-
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
-