/** * Helper method used to find inheritance (implements, extends) path * between given types, if one exists (caller generally checks before * calling this method). Returned type represents given <b>subtype</b>, * with supertype linkage extending to <b>supertype</b>. */ protected HierarchicType _findSuperTypeChain(Class<?> subtype, Class<?> supertype) { // If super-type is a class (not interface), bit simpler if (supertype.isInterface()) { return _findSuperInterfaceChain(subtype, supertype); } return _findSuperClassChain(subtype, supertype); }
protected HierarchicType _doFindSuperInterfaceChain(HierarchicType current, Class<?> target) { Class<?> raw = current.getRawClass(); Type[] parents = raw.getGenericInterfaces(); // as long as there are superclasses // and unless we have already seen the type (<T extends X<T>>) if (parents != null) { for (Type parent : parents) { HierarchicType sup = _findSuperInterfaceChain(parent, target); if (sup != null) { sup.setSubType(current); current.setSuperType(sup); return current; } } } // and then super-class if any Type parent = raw.getGenericSuperclass(); if (parent != null) { HierarchicType sup = _findSuperInterfaceChain(parent, target); if (sup != null) { sup.setSubType(current); current.setSuperType(sup); return current; } } return null; }
/** * Helper method used to find inheritance (implements, extends) path * between given types, if one exists (caller generally checks before * calling this method). Returned type represents given <b>subtype</b>, * with supertype linkage extending to <b>supertype</b>. */ protected HierarchicType _findSuperTypeChain(Class<?> subtype, Class<?> supertype) { // If super-type is a class (not interface), bit simpler if (supertype.isInterface()) { return _findSuperInterfaceChain(subtype, supertype); } return _findSuperClassChain(subtype, supertype); }
protected HierarchicType _doFindSuperInterfaceChain(HierarchicType current, Class<?> target) { Class<?> raw = current.getRawClass(); Type[] parents = raw.getGenericInterfaces(); // as long as there are superclasses // and unless we have already seen the type (<T extends X<T>>) if (parents != null) { for (Type parent : parents) { HierarchicType sup = _findSuperInterfaceChain(parent, target); if (sup != null) { sup.setSubType(current); current.setSuperType(sup); return current; } } } // and then super-class if any Type parent = raw.getGenericSuperclass(); if (parent != null) { HierarchicType sup = _findSuperInterfaceChain(parent, target); if (sup != null) { sup.setSubType(current); current.setSuperType(sup); return current; } } return null; }
/** * Helper method used to find inheritance (implements, extends) path * between given types, if one exists (caller generally checks before * calling this method). Returned type represents given <b>subtype</b>, * with supertype linkage extending to <b>supertype</b>. */ protected static HierarchicType _findSuperTypeChain(Class<?> subtype, Class<?> supertype) { // If super-type is a class (not interface), bit simpler if (supertype.isInterface()) { return _findSuperInterfaceChain(subtype, supertype); } return _findSuperClassChain(subtype, supertype); }
/** * Helper method used to find inheritance (implements, extends) path * between given types, if one exists (caller generally checks before * calling this method). Returned type represents given <b>subtype</b>, * with supertype linkage extending to <b>supertype</b>. */ protected HierarchicType _findSuperTypeChain(Class<?> subtype, Class<?> supertype) { // If super-type is a class (not interface), bit simpler if (supertype.isInterface()) { return _findSuperInterfaceChain(subtype, supertype); } return _findSuperClassChain(subtype, supertype); }
/** * Helper method used to find inheritance (implements, extends) path * between given types, if one exists (caller generally checks before * calling this method). Returned type represents given <b>subtype</b>, * with supertype linkage extending to <b>supertype</b>. */ protected HierarchicType _findSuperTypeChain(Class<?> subtype, Class<?> supertype) { // If super-type is a class (not interface), bit simpler if (supertype.isInterface()) { return _findSuperInterfaceChain(subtype, supertype); } return _findSuperClassChain(subtype, supertype); }
protected HierarchicType _doFindSuperInterfaceChain(HierarchicType current, Class<?> target) { Class<?> raw = current.getRawClass(); Type[] parents = raw.getGenericInterfaces(); // as long as there are superclasses // and unless we have already seen the type (<T extends X<T>>) if (parents != null) { for (Type parent : parents) { HierarchicType sup = _findSuperInterfaceChain(parent, target); if (sup != null) { sup.setSubType(current); current.setSuperType(sup); return current; } } } // and then super-class if any Type parent = raw.getGenericSuperclass(); if (parent != null) { HierarchicType sup = _findSuperInterfaceChain(parent, target); if (sup != null) { sup.setSubType(current); current.setSuperType(sup); return current; } } return null; }
protected HierarchicType _doFindSuperInterfaceChain(HierarchicType current, Class<?> target) { Class<?> raw = current.getRawClass(); Type[] parents = raw.getGenericInterfaces(); // as long as there are superclasses // and unless we have already seen the type (<T extends X<T>>) if (parents != null) { for (Type parent : parents) { HierarchicType sup = _findSuperInterfaceChain(parent, target); if (sup != null) { sup.setSubType(current); current.setSuperType(sup); return current; } } } // and then super-class if any Type parent = raw.getGenericSuperclass(); if (parent != null) { HierarchicType sup = _findSuperInterfaceChain(parent, target); if (sup != null) { sup.setSubType(current); current.setSuperType(sup); return current; } } return null; }
HierarchicType sup = _findSuperInterfaceChain(parent, target); if (sup != null) { sup.setSubType(current); HierarchicType sup = _findSuperInterfaceChain(parent, target); if (sup != null) { sup.setSubType(current);