static void recursivePush(Type t, Class<?> baseInterface, Stack<Type> superinterfaces) { Class<?> currentClass = null; if (t instanceof Class) { currentClass = (Class) t; } else if (t instanceof ParameterizedType) { currentClass = (Class) ((ParameterizedType) t).getRawType(); } if (baseInterface.isAssignableFrom(currentClass)) { superinterfaces.push(t); for (Type otherType : currentClass.getGenericInterfaces()) { recursivePush(otherType, baseInterface, superinterfaces); } } } }
Type currentType; Class<?> currentClass = clazz; recursivePush(currentClass, baseInterface, superinterfaces);
static void recursivePush(Type t, Class<?> baseInterface, Stack<Type> superinterfaces) { Class<?> currentClass = null; if (t instanceof Class) { currentClass = (Class) t; } else if (t instanceof ParameterizedType) { currentClass = (Class) ((ParameterizedType) t).getRawType(); } if (baseInterface.isAssignableFrom(currentClass)) { superinterfaces.push(t); for (Type otherType : currentClass.getGenericInterfaces()) { recursivePush(otherType, baseInterface, superinterfaces); } } } }
static void recursivePush(Type t, Class<?> baseInterface, Stack<Type> superinterfaces) { Class<?> currentClass = null; if (t instanceof Class) { currentClass = (Class) t; } else if (t instanceof ParameterizedType) { currentClass = (Class) ((ParameterizedType) t).getRawType(); } if (baseInterface.isAssignableFrom(currentClass)) { superinterfaces.push(t); for (Type otherType : currentClass.getGenericInterfaces()) { recursivePush(otherType, baseInterface, superinterfaces); } } } }
Type currentType; Class<?> currentClass = clazz; recursivePush(currentClass, baseInterface, superinterfaces);
Type currentType; Class<?> currentClass = clazz; recursivePush(currentClass, baseInterface, superinterfaces);