getComponentType
配列の要素のクラスを返す。
Class#getComponentType()は多次元配列の場合、1次元目の要素のクラスが配列クラスとなるのでその代用。
クラスが配列でなくなるまでClass#getComponentType()を再帰呼び出しする。
public static Class getComponentType(Class clazz) { if (clazz.isArray()) { return getComponentType(clazz.getComponentType()); } else { return clazz; } }