com.sun.xml.bind.v2.model.nav
public final class ReflectionNavigator extends Object implements Navigator<Type,Class,Field,Method>
Constructor Summary | |
---|---|
ReflectionNavigator()
Singleton.
|
Method Summary | |
---|---|
Class | asDecl(Type t) |
Class | asDecl(Class c) |
Type | createParameterizedType(Class rawType, Type... arguments)
Returns the Type object that represents {@code clazz<T1,T2,T3>}. |
<T> Class<T> | erasure(Type t)
Returns the runtime representation of the given type.
|
Class | findClass(String className, Class referencePoint) |
Type | getBaseClass(Type t, Class sup) |
Location | getClassLocation(Class clazz) |
String | getClassName(Class clazz) |
String | getClassShortName(Class clazz) |
Type | getComponentType(Type t) |
Field | getDeclaredField(Class clazz, String fieldName) |
Collection<? extends Field> | getDeclaredFields(Class clazz) |
Collection<? extends Method> | getDeclaredMethods(Class clazz) |
Class | getDeclaringClassForField(Field field) |
Class | getDeclaringClassForMethod(Method method) |
Field[] | getEnumConstants(Class clazz) |
Location | getFieldLocation(Field field) |
String | getFieldName(Field field) |
Type | getFieldType(Field field) |
Location | getMethodLocation(Method method) |
String | getMethodName(Method method) |
Type[] | getMethodParameters(Method method) |
String | getPackageName(Class clazz) |
Type | getPrimitive(Class primitiveType) |
Type | getReturnType(Method method) |
Class | getSuperClass(Class clazz) |
Type | getTypeArgument(Type type, int i) |
String | getTypeName(Type type) |
Type | getVoidType() |
boolean | hasDefaultConstructor(Class c) |
boolean | isAbstract(Class clazz) |
boolean | isArray(Type t) |
boolean | isArrayButNotByteArray(Type t) |
boolean | isBridgeMethod(Method method) |
boolean | isEnum(Class c) |
boolean | isFinal(Class clazz) |
boolean | isFinalMethod(Method method) |
boolean | isInnerClass(Class clazz) |
boolean | isInterface(Class clazz) |
boolean | isOverriding(Method method, Class base) |
boolean | isParameterizedType(Type type) |
boolean | isPrimitive(Type type) |
boolean | isPublicField(Field field) |
boolean | isPublicMethod(Method method) |
boolean | isStaticField(Field field) |
boolean | isStaticMethod(Method method) |
boolean | isSubClassOf(Type sub, Type sup) |
boolean | isTransient(Field f) |
Class | ref(Class c) |
Class | use(Class c) |
Because of the difference in the way APT and the Java reflection treats primitive type and array type, we can't define this method on Navigator.
It made me realize how difficult it is to define the common navigation layer for two different underlying reflection library. The other way is to throw away the entire parameterization and go to the wrapper approach.