public final class JandexUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.jboss.jandex.DotName |
DOTNAME_OBJECT |
| Modifier and Type | Method and Description |
|---|---|
static String |
getBoxedTypeName(org.jboss.jandex.Type type) |
static org.jboss.jandex.ClassInfo |
getEnclosingClass(org.jboss.jandex.AnnotationInstance annotationInstance)
Returns the enclosing class of the given annotation instance.
|
static boolean |
isSubclassOf(org.jboss.jandex.IndexView index,
org.jboss.jandex.ClassInfo info,
org.jboss.jandex.DotName parentName)
Returns true if the given Jandex ClassInfo is a subclass of the given parentName.
|
static List<org.jboss.jandex.Type> |
resolveTypeParameters(org.jboss.jandex.DotName input,
org.jboss.jandex.DotName target,
org.jboss.jandex.IndexView index)
Returns the captured generic types of an interface given a class that at some point in the class
hierarchy implements the interface.
|
public static List<org.jboss.jandex.Type> resolveTypeParameters(org.jboss.jandex.DotName input, org.jboss.jandex.DotName target, org.jboss.jandex.IndexView index)
class MyList implements List<String> {
...
}
If we call
JandexUtil.resolveTypeParameters(DotName.createSimple(MyList.class.getName()),
DotName.createSimple(List.class.getName()), index)
then the result will contain a single element of class ClassType whose name() would return a DotName for Stringpublic static org.jboss.jandex.ClassInfo getEnclosingClass(org.jboss.jandex.AnnotationInstance annotationInstance)
annotationInstance - the annotation whose enclosing class to look up.public static boolean isSubclassOf(org.jboss.jandex.IndexView index,
org.jboss.jandex.ClassInfo info,
org.jboss.jandex.DotName parentName)
throws BuildException
index - the index to use to look up super classes.info - the ClassInfo we want to check.parentName - the name of the superclass we want to find.BuildException - if one of the superclasses is not indexed.public static String getBoxedTypeName(org.jboss.jandex.Type type)
Copyright © 2021 JBoss by Red Hat. All rights reserved.