|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object extended by org.jopendocument.util.ReflectUtils
public final class ReflectUtils
| Constructor Summary | |
|---|---|
ReflectUtils()
|
|
| Method Summary | ||
|---|---|---|
static
|
getTypeArguments(Class<? extends T> childClass,
Class<T> baseClass)
Search for the list of class used to extend/implement a generic class/interface. |
|
static
|
getTypeArguments(U o,
Class<U> raw)
|
|
static
|
getTypeArgumentsMap(Class<? extends T> childClass,
Class<T> baseClass)
The map of type arguments of baseClass to actual type for childClass. |
|
static
|
isCastable(U o,
Class<U> raw,
Class... typeArgs)
Whether o can be casted to raw<typeArgs>. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReflectUtils()
| Method Detail |
|---|
public static <T> Map<TypeVariable<Class<T>>,Class<?>> getTypeArgumentsMap(Class<? extends T> childClass, Class<T> baseClass)
T - the type of the baseClass.childClass - the class to test, eg Props.class with PropsbaseClass - the generic superclass, eg Map.class.
public static <T> List<Class<?>> getTypeArguments(Class<? extends T> childClass, Class<T> baseClass)
T - the type of the baseClass.childClass - the class to test, eg Props.class with PropsbaseClass - the generic superclass, eg Map.class.
null, eg [Boolean.class].public static <U> List<Class<?>> getTypeArguments(U o, Class<U> raw)
public static <U> boolean isCastable(U o, Class<U> raw, Class... typeArgs)
U - type of the superclass.o - the instance to check, eg new MapOfInt2Boolean().raw - the generic superclass, eg Map.class.typeArgs - arguments to raw, eg Integer.class, Boolean.class.
true : new MapOfInt2Boolean()
is a Map<Integer, Boolean>.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||