|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectorg.seasar.aptina.commons.util.ElementUtils
public class ElementUtils
Element を扱うユーティリティです.
| メソッドの概要 | |
|---|---|
static AnnotationMirror |
getAnnotationMirror(Element element,
Class<? extends Annotation> annotationClass)
Element に付けられた指定の AnnotationMirror を返します. |
static AnnotationMirror |
getAnnotationMirror(Element element,
String annotationClassName)
Element に付けられた指定の AnnotationMirror を返します. |
static ExecutableElement |
getConstructorElement(TypeElement typeElement)
型エレメントに定義されたデフォルトコンストラクタの実行可能エレメントを返します. |
static ExecutableElement |
getConstructorElement(TypeElement typeElement,
Class<?>... parameterTypes)
型エレメントに定義されたコンストラクタの実行可能エレメントを返します. |
static ExecutableElement |
getConstructorElement(TypeElement typeElement,
String... parameterTypeNames)
型エレメントに定義されたコンストラクタの実行可能エレメントを返します. |
static VariableElement |
getFieldElement(TypeElement typeElement,
Field field)
型エレメントに定義されたフィールドの変数エレメントを返します. |
static VariableElement |
getFieldElement(TypeElement typeElement,
String fieldName)
型エレメントに定義されたフィールドの変数エレメントを返します. |
static ExecutableElement |
getMethodElement(TypeElement typeElement,
String methodName)
型エレメントに定義されたメソッドの実行可能エレメントを返します. |
static ExecutableElement |
getMethodElement(TypeElement typeElement,
String methodName,
Class<?>... parameterTypes)
型エレメントに定義されたメソッドの実行可能エレメントを返します. |
static ExecutableElement |
getMethodElement(TypeElement typeElement,
String methodName,
String... parameterTypeNames)
型エレメントに定義されたメソッドの実行可能エレメントを返します. |
static TypeElement |
getTypeElement(Elements elementUtils,
Class<?> clazz)
クラスに対応する TypeElement を返します. |
static TypeElement |
getTypeElement(Elements elementUtils,
String className)
クラス名に対応する TypeElement を返します. |
static boolean |
isSameTypes(Class<?>[] parameterTypes,
List<? extends VariableElement> variableElements)
引数型の配列と VariableElementのリストの, それぞれの要素の型名が等しければ true を返します. |
static boolean |
isSameTypes(String[] typeNames,
List<? extends VariableElement> variableElements)
型名の配列と VariableElementのリストの, それぞれの要素の型名が等しければ true を返します. |
static List<String> |
toSimpleNameList(List<? extends Element> elements)
Element.getSimpleName() が返す名前の List を返します. |
static String |
toStringOfTypeParameterDecl(List<? extends TypeParameterElement> typeParameters)
型引数宣言の完全な文字列表現を返します. |
static String |
toStringOfTypeParameterNames(List<? extends TypeParameterElement> typeParameters)
型引数宣言の変数名の文字列表現を返します. |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| メソッドの詳細 |
|---|
public static TypeElement getTypeElement(Elements elementUtils,
Class<?> clazz)
TypeElement を返します.
コンパイルのコンテキスト外でこのメソッドが返す TypeElement およびその
Element.getEnclosedElements() が返す Element から,
Elements.getDocComment(Element) を使って Javadoc コメントを取得することはできません.
elementUtils - Elementsclazz - クラス
TypeElement, 存在しない場合は null
public static TypeElement getTypeElement(Elements elementUtils,
String className)
TypeElement を返します.
コンパイルのコンテキスト外でこのメソッドが返す TypeElement およびその
Element.getEnclosedElements() が返す Element から,
Elements.getDocComment(Element) を使って Javadoc コメントを取得することはできません.
elementUtils - ElementsclassName - クラスの完全限定名
TypeElement, 存在しない場合は null
public static VariableElement getFieldElement(TypeElement typeElement,
Field field)
typeElement - 型エレメントfield - フィールド
null
public static VariableElement getFieldElement(TypeElement typeElement,
String fieldName)
typeElement - 型エレメントfieldName - フィールド名
nullpublic static ExecutableElement getConstructorElement(TypeElement typeElement)
typeElement - 型エレメント
null
public static ExecutableElement getConstructorElement(TypeElement typeElement,
Class<?>... parameterTypes)
引数型が型引数を持つ場合は getConstructorElement(TypeElement, String...)
を使用してください.
typeElement - 型エレメントparameterTypes - 引数型の並び
null
public static ExecutableElement getConstructorElement(TypeElement typeElement,
String... parameterTypeNames)
引数がの型が配列の場合は, 要素型の名前の後に [] を連ねる形式と, [[LString;
のような形式のどちらでも指定することができます.
引数型が型引数を持つ場合は "java.util.List<T>" のようにそのまま指定します.
typeElement - 型エレメントparameterTypeNames - 引数の型名の並び
null
public static ExecutableElement getMethodElement(TypeElement typeElement,
String methodName)
typeElement - 型エレメントmethodName - メソッド名
null
public static ExecutableElement getMethodElement(TypeElement typeElement,
String methodName,
Class<?>... parameterTypes)
引数型が型引数を持つ場合は getMethodElement(TypeElement, String, String...)
を使用してください.
typeElement - 型エレメントmethodName - メソッド名parameterTypes - 引数型の並び
null
public static ExecutableElement getMethodElement(TypeElement typeElement,
String methodName,
String... parameterTypeNames)
引数がの型が配列の場合は, 要素型の名前の後に [] を連ねる形式と, [[LString;
のような形式のどちらでも指定することができます.
引数型が型引数を持つ場合は "java.util.List<T>" のようにそのまま指定します.
typeElement - 型エレメントmethodName - メソッド名parameterTypeNames - 引数の型名の並び
null
public static AnnotationMirror getAnnotationMirror(Element element,
Class<? extends Annotation> annotationClass)
Element に付けられた指定の AnnotationMirror を返します.
element - 注釈の付けられた ElementannotationClass - アノテーションのクラス
Element に付けられた指定の AnnotationMirror
public static AnnotationMirror getAnnotationMirror(Element element,
String annotationClassName)
Element に付けられた指定の AnnotationMirror を返します.
element - 注釈の付けられた ElementannotationClassName - アノテーションのクラス名
Element に付けられた指定の AnnotationMirror
public static boolean isSameTypes(Class<?>[] parameterTypes,
List<? extends VariableElement> variableElements)
VariableElementのリストの, それぞれの要素の型名が等しければ true を返します.
parameterTypes - 引数型の配列variableElements -
true
public static boolean isSameTypes(String[] typeNames,
List<? extends VariableElement> variableElements)
VariableElementのリストの, それぞれの要素の型名が等しければ true を返します.
typeNames - 型名の配列variableElements -
truepublic static List<String> toSimpleNameList(List<? extends Element> elements)
Element.getSimpleName() が返す名前の List を返します.
elements - Element の List
Element.getSimpleName() が返す名前の Listpublic static String toStringOfTypeParameterDecl(List<? extends TypeParameterElement> typeParameters)
typeParameters - 型引数の List
public static String toStringOfTypeParameterNames(List<? extends TypeParameterElement> typeParameters)
typeParameters - 型引数の List
|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||