org.seasar.aptina.commons.util
クラス TypeMirrorUtils

java.lang.Object
  上位を拡張 org.seasar.aptina.commons.util.TypeMirrorUtils

public class TypeMirrorUtils
extends Object

TypeMirror を扱うユーティリティです.

作成者:
koichik

フィールドの概要
static Map<String,TypeKind> PRIMITIVE_TYPES
          プリミティブ型の名前と TypeKind のマップです.
 
メソッドの概要
static TypeMirror getTypeMirror(Types typeUtils, Elements elementUtils, Class<?> clazz)
          クラスに対応する TypeMirror を返します.
static TypeMirror getTypeMirror(Types typeUtils, Elements elementUtils, String className)
          クラス名に対応する TypeMirror を返します.
static TypeMirror toArrayType(Types typeUtils, TypeMirror componentTypeMirror)
          引数の型を要素とする配列の TypeMirror を返します.
static List<TypeMirror> toTypeMirrors(Types typeUtils, Elements elementUtils, Class<?>... types)
          クラスの配列を TypeMirror の配列に変換して返します.
static List<TypeMirror> toTypeMirrors(Types typeUtils, Elements elementUtils, String... typeNames)
          クラス名の配列を TypeMirror の配列に変換して返します.
static List<String> toTypeNameList(List<? extends TypeMirror> typeMirrors)
          TypeMirror の文字列表現の List を返します.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

PRIMITIVE_TYPES

public static final Map<String,TypeKind> PRIMITIVE_TYPES
プリミティブ型の名前と TypeKind のマップです.

メソッドの詳細

getTypeMirror

public static TypeMirror getTypeMirror(Types typeUtils,
                                       Elements elementUtils,
                                       Class<?> clazz)
クラスに対応する TypeMirror を返します.

パラメータ:
typeUtils - Types
elementUtils - Elements
clazz - クラス
戻り値:
クラスに対応するTypeMirror, クラスが存在しない場合は null

getTypeMirror

public static TypeMirror getTypeMirror(Types typeUtils,
                                       Elements elementUtils,
                                       String className)
クラス名に対応する TypeMirror を返します.

配列の場合は要素型の名前の後に [] を連ねる形式と, [[LString; のような 形式のどちらでも指定することができます.

パラメータ:
typeUtils - Types
elementUtils - Elements
className - クラスの完全限定名
戻り値:
クラスに対応するTypeMirror, クラスが存在しない場合は null

toArrayType

public static TypeMirror toArrayType(Types typeUtils,
                                     TypeMirror componentTypeMirror)
引数の型を要素とする配列の TypeMirror を返します.

パラメータ:
typeUtils - Types
componentTypeMirror - 配列の要素となる型
戻り値:
引数の型を要素とする配列の TypeMirror
関連項目:
Types.getArrayType(TypeMirror)

toTypeMirrors

public static List<TypeMirror> toTypeMirrors(Types typeUtils,
                                             Elements elementUtils,
                                             Class<?>... types)
                                      throws IllegalArgumentException
クラスの配列を TypeMirror の配列に変換して返します.

パラメータ:
typeUtils - Types
elementUtils - Elements
types - クラスの配列
戻り値:
TypeMirror の配列
例外:
IllegalArgumentException - 配列の要素のクラスに対応する TypeMirror が存在しない場合

toTypeMirrors

public static List<TypeMirror> toTypeMirrors(Types typeUtils,
                                             Elements elementUtils,
                                             String... typeNames)
クラス名の配列を TypeMirror の配列に変換して返します.

パラメータ:
typeUtils - Types
elementUtils - Elements
typeNames - クラス名の配列
戻り値:
TypeMirror の配列
例外:
IllegalArgumentException - 配列の要素のクラスに対応する TypeMirror が存在しない場合

toTypeNameList

public static List<String> toTypeNameList(List<? extends TypeMirror> typeMirrors)
TypeMirror の文字列表現の List を返します.

パラメータ:
typeMirrors - TypeMirrorList
戻り値:
TypeMirror の文字列表現の List


Copyright © 2009-2010 The Seasar Foundation. All Rights Reserved.