@Test public void testAbstractSingle() { final Index index = index(Single.class, AbstractSingle.class); final DotName impl = DotName.createSimple(AbstractSingle.class.getName()); List<Type> ret = JandexUtil.resolveTypeParameters(impl, SIMPLE, index); assertThat(ret).hasSize(1).allMatch(t -> t.kind() == Kind.TYPE_VARIABLE && t.asTypeVariable().identifier().equals("S")); }
public static List<Type> resolveTypeParameters(DotName input, DotName target, IndexView index) { final ClassInfo inputClassInfo = fetchFromIndex(input, index); Type startingType = getType(inputClassInfo, index); final List<Type> result = findParametersRecursively(startingType, target, new HashSet<>(), index); if (result == null) { return Collections.emptyList(); } return result; }
JandexUtil { public static List<Type> resolveTypeParameters(DotName input, DotName target, IndexView index) { final ClassInfo inputClassInfo = fetchFromIndex(input, index); Type startingType = getType(inputClassInfo, index); final List<Type> result = findParametersRecursively(startingType, target, new HashSet<>(), index); if (result == null) { return Collections.emptyList(); } return result; } }
JandexUtil { public static List<Type> resolveTypeParameters(DotName input, DotName target, IndexView index) { final ClassInfo inputClassInfo = fetchFromIndex(input, index); Type startingType = getType(inputClassInfo, index); final List<Type> result = findParametersRecursively(startingType, target, new HashSet<>(), index); if (result == null) { return Collections.emptyList(); } return result; } private  JandexUtil(); }
JandexUtil { public static List<Type> resolveTypeParameters(DotName input, DotName target, IndexView index) { final ClassInfo inputClassInfo = fetchFromIndex(input, index); Type startingType = getType(inputClassInfo, index); final List<Type> result = findParametersRecursively(startingType, target, new HashSet<>(), index); if (result == null) { return Collections.emptyList(); } return result; } private  JandexUtil(); static List<Type> resolveTypeParameters(DotName input, DotName target, IndexView index); static ClassInfo getEnclosingClass(AnnotationInstance annotationInstance); static boolean isSubclassOf(IndexView index, ClassInfo info, DotName parentName); @SuppressWarnings("incomplete-switch") static String getBoxedTypeName(Type type); }
JandexUtil { public static List<Type> resolveTypeParameters(DotName input, DotName target, IndexView index) { final ClassInfo inputClassInfo = fetchFromIndex(input, index); Type startingType = getType(inputClassInfo, index); final List<Type> result = findParametersRecursively(startingType, target, new HashSet<>(), index); if (result == null) { return Collections.emptyList(); } return result; } private  JandexUtil(); static List<Type> resolveTypeParameters(DotName input, DotName target, IndexView index); static ClassInfo getEnclosingClass(AnnotationInstance annotationInstance); static boolean isSubclassOf(IndexView index, ClassInfo info, DotName parentName); @SuppressWarnings("incomplete-switch") static String getBoxedTypeName(Type type); final static DotName DOTNAME_OBJECT; }