public final class Parameter extends Object implements AnnotatedElement
Parameterは、名前および修飾子を含む、メソッド・パラメータに関する情報を提供します。また、パラメータの属性を取得する代替手段も提供します。| 修飾子と型 | メソッドと説明 |
|---|---|
boolean |
equals(Object obj)
実行可能ファイルとインデックスに基づいて比較します。
|
AnnotatedType |
getAnnotatedType()
このParameterによって表される仮パラメータの型を指定する型の使用を表すAnnotatedTypeオブジェクトを返します。
|
<T extends Annotation> |
getAnnotation(Class<T> annotationClass)
存在する場合は、この要素の指定された型の注釈を返し、そうでない場合はnullを返します。
|
Annotation[] |
getAnnotations()
この要素に存在する注釈を返します。
|
<T extends Annotation> |
getAnnotationsByType(Class<T> annotationClass)
この要素に関連付けられている注釈を返します。
|
<T extends Annotation> |
getDeclaredAnnotation(Class<T> annotationClass)
直接存在する場合は、この要素の指定された型の注釈を返し、そうでない場合はnullを返します。
|
Annotation[] |
getDeclaredAnnotations()
この要素に直接存在する注釈を返します。
|
<T extends Annotation> |
getDeclaredAnnotationsByType(Class<T> annotationClass)
直接存在するか間接的に存在する場合は、この要素の指定された型の注釈を返します。
|
Executable |
getDeclaringExecutable()
このパラメータを宣言する
Executableを返します。 |
int |
getModifiers()
この
Parameterオブジェクトによって表されるパラメータの修飾子フラグを取得します。 |
String |
getName()
パラメータの名前を返します。
|
Type |
getParameterizedType()
Parameterオブジェクトで表されるパラメータのパラメータ化された型を識別するTypeオブジェクトを返します。 |
Class<?> |
getType()
この
Parameterオブジェクトによって表されるパラメータの宣言された型を識別するClassオブジェクトを返します。 |
int |
hashCode()
実行可能要素のハッシュ・コードおよびインデックスに基づくハッシュ・コードを返します。
|
boolean |
isImplicit()
このパラメータがソース・コードで暗黙的に宣言されている場合は
trueを返し、そうでない場合はfalseを返します。 |
boolean |
isNamePresent()
パラメータがクラス・ファイルに従った名前を持つ場合はtrueを返し、そうでない場合はfalseを返します。
|
boolean |
isSynthetic()
このパラメータがソース・コードで暗黙的にも明示的にも宣言されていない場合は
trueを返し、そうでない場合はfalseを返します。 |
boolean |
isVarArgs()
このパラメータが可変引数リストを表す場合は
trueを返し、そうでない場合はfalseを返します。 |
String |
toString()
このパラメータを記述した文字列を返します。
|
isAnnotationPresentpublic boolean equals(Object obj)
equals、クラス: Objectobj - 比較するオブジェクトObject.hashCode()、HashMappublic int hashCode()
hashCode、クラス: ObjectObject.equals(java.lang.Object), System.identityHashCode(java.lang.Object)public boolean isNamePresent()
public String toString()
public Executable getDeclaringExecutable()
Executableを返します。Executablepublic int getModifiers()
Parameterオブジェクトによって表されるパラメータの修飾子フラグを取得します。public String getName()
public Type getParameterizedType()
Parameterオブジェクトで表されるパラメータのパラメータ化された型を識別するTypeオブジェクトを返します。Typeオブジェクトpublic Class<?> getType()
Parameterオブジェクトによって表されるパラメータの宣言された型を識別するClassオブジェクトを返します。Classオブジェクトpublic AnnotatedType getAnnotatedType()
AnnotatedTypeオブジェクトpublic boolean isImplicit()
trueを返し、そうでない場合はfalseを返します。public boolean isSynthetic()
trueを返し、そうでない場合はfalseを返します。public boolean isVarArgs()
trueを返し、そうでない場合はfalseを返します。truepublic <T extends Annotation> T getAnnotation(Class<T> annotationClass)
getAnnotation、インタフェース: AnnotatedElementT - 照会し、存在する場合に返す注釈の型。annotationClass - 注釈型に対応するClassオブジェクトNullPointerException - 指定された注釈クラスがnullの場合public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass)
AnnotatedElement.getAnnotation(Class)の違いは、このメソッドではその引数が繰返し可能な注釈型 (JLS 9.6)であるかどうかが検出され、繰返し可能な注釈型である場合は、コンテナ注釈を調べることで、その型の1つ以上の注釈の検索が試みられることです。このメソッドの呼出し元は、返された配列を自由に変更することができ、これはほかの呼出し元に返された配列に影響を及ぼしません。getAnnotationsByType、インタフェース: AnnotatedElementT - 照会し、存在する場合に返す注釈の型。annotationClass - 注釈型に対応するClassオブジェクトNullPointerException - 指定された注釈クラスがnullの場合public Annotation[] getDeclaredAnnotations()
getDeclaredAnnotations、インタフェース: AnnotatedElementpublic <T extends Annotation> T getDeclaredAnnotation(Class<T> annotationClass)
AnnotatedElementgetDeclaredAnnotation、インタフェース: AnnotatedElementT - 照会し、直接存在する場合に返す注釈の型。annotationClass - 注釈型に対応するClassオブジェクトNullPointerException - 指定された注釈クラスがnullの場合public <T extends Annotation> T[] getDeclaredAnnotationsByType(Class<T> annotationClass)
AnnotatedElementAnnotatedElement.getDeclaredAnnotation(Class)の違いは、このメソッドではその引数が繰返し可能な注釈型 (JLS 9.6)であるかどうかが検出され、繰返し可能な注釈型である場合は、コンテナ注釈(存在する場合)を調べることで、その型の1つ以上の注釈の検索が試みられることです。このメソッドの呼出し元は、返された配列を自由に変更することができ、これはほかの呼出し元に返された配列に影響を及ぼしません。getDeclaredAnnotationsByType、インタフェース: AnnotatedElementT - 照会し、直接または間接的に存在する場合に返す注釈の型。annotationClass - 注釈型に対応するClassオブジェクトNullPointerException - 指定された注釈クラスがnullの場合public Annotation[] getAnnotations()
getAnnotations、インタフェース: AnnotatedElement バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright© 1993, 2014, Oracle and/or its affiliates. All rights reserved.