public class JandexUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JandexUtil.JaxRsParameterInfo
Holds relevant information about a jax-rs method parameter.
|
static class |
JandexUtil.RefType
Simple enum to indicate the type of a $ref being read/written.
|
| Modifier and Type | Method and Description |
|---|---|
static BigDecimal |
bigDecimalValue(org.jboss.jandex.AnnotationInstance annotation,
String propertyName)
Reads a Double property value from the given annotation instance.
|
static Boolean |
booleanValue(org.jboss.jandex.AnnotationInstance annotation,
String propertyName)
Reads a Boolean property value from the given annotation instance.
|
static Boolean |
booleanValueWithDefault(org.jboss.jandex.AnnotationInstance annotation,
String propertyName) |
static <T extends Enum> |
enumValue(org.jboss.jandex.AnnotationInstance annotation,
String propertyName,
Class<T> clazz)
Reads a String property value from the given annotation instance.
|
static org.jboss.jandex.AnnotationInstance |
getClassAnnotation(org.jboss.jandex.ClassInfo ct,
org.jboss.jandex.DotName name)
Gets a single class annotation from the given class.
|
static Collection<org.jboss.jandex.ClassInfo> |
getJaxRsResourceClasses(org.jboss.jandex.IndexView index)
Use the jandex index to find all jax-rs resource classes.
|
static JandexUtil.JaxRsParameterInfo |
getMethodParameterJaxRsInfo(org.jboss.jandex.MethodInfo method,
int idx)
Returns jax-rs info about the parameter at the given index.
|
static org.jboss.jandex.Type |
getMethodParameterType(org.jboss.jandex.MethodInfo method,
short position)
Returns the class type of the method parameter at the given position.
|
static List<org.jboss.jandex.AnnotationInstance> |
getParameterAnnotations(org.jboss.jandex.MethodInfo method,
short paramPosition)
Returns all annotations configured for a single parameter of a method.
|
static List<org.jboss.jandex.AnnotationInstance> |
getRepeatableAnnotation(org.jboss.jandex.ClassInfo clazz,
org.jboss.jandex.DotName singleAnnotationName,
org.jboss.jandex.DotName repeatableAnnotationName)
Many OAI annotations can either be found singly or as a wrapped array.
|
static List<org.jboss.jandex.AnnotationInstance> |
getRepeatableAnnotation(org.jboss.jandex.MethodInfo method,
org.jboss.jandex.DotName singleAnnotationName,
org.jboss.jandex.DotName repeatableAnnotationName)
Many OAI annotations can either be found singly or as a wrapped array.
|
static org.jboss.jandex.Type |
getRequestBodyParameterClassType(org.jboss.jandex.MethodInfo method)
Go through the method parameters looking for one that is not annotated with a jax-rs
annotation.
|
static Integer |
intValue(org.jboss.jandex.AnnotationInstance annotation,
String propertyName)
Reads a Integer property value from the given annotation instance.
|
static boolean |
isEmpty(org.jboss.jandex.AnnotationInstance annotation)
Returns true if the given annotation is void of any values (and thus is "empty").
|
static boolean |
isRef(org.jboss.jandex.AnnotationInstance annotation)
Returns true if the given annotation instance is a "ref".
|
static boolean |
isSimpleArraySchema(org.jboss.jandex.AnnotationInstance annotation)
Returns true if the given @Schema annotation is a simple array schema.
|
static boolean |
isSimpleClassSchema(org.jboss.jandex.AnnotationInstance annotation)
Returns true if the given @Schema annotation is a simple class schema.
|
static String |
nameFromRef(org.jboss.jandex.AnnotationInstance annotation)
Gets the name of an item from its ref.
|
static String |
refValue(org.jboss.jandex.AnnotationInstance annotation,
JandexUtil.RefType refType)
Reads a string property named "ref" value from the given annotation and converts it
to a value appropriate for setting on a model's "$ref" property.
|
static List<String> |
stringListValue(org.jboss.jandex.AnnotationInstance annotation,
String propertyName)
Reads a String array property value from the given annotation instance.
|
static String |
stringValue(org.jboss.jandex.AnnotationInstance annotation,
String propertyName)
Reads a String property value from the given annotation instance.
|
public static String refValue(org.jboss.jandex.AnnotationInstance annotation, JandexUtil.RefType refType)
annotation - refType - public static String stringValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
annotation - propertyName - public static Boolean booleanValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
annotation - propertyName - public static Boolean booleanValueWithDefault(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
public static BigDecimal bigDecimalValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
annotation - propertyName - public static Integer intValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
annotation - propertyName - public static List<String> stringListValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
annotation - propertyName - public static <T extends Enum> T enumValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName, Class<T> clazz)
annotation - propertyName - public static boolean isRef(org.jboss.jandex.AnnotationInstance annotation)
annotation - public static boolean isEmpty(org.jboss.jandex.AnnotationInstance annotation)
annotation - public static org.jboss.jandex.AnnotationInstance getClassAnnotation(org.jboss.jandex.ClassInfo ct,
org.jboss.jandex.DotName name)
ct - name - public static Collection<org.jboss.jandex.ClassInfo> getJaxRsResourceClasses(org.jboss.jandex.IndexView index)
pathAnnotations - index - public static List<org.jboss.jandex.AnnotationInstance> getParameterAnnotations(org.jboss.jandex.MethodInfo method, short paramPosition)
method - paramPosition - public static String nameFromRef(org.jboss.jandex.AnnotationInstance annotation)
annotation - public static List<org.jboss.jandex.AnnotationInstance> getRepeatableAnnotation(org.jboss.jandex.MethodInfo method, org.jboss.jandex.DotName singleAnnotationName, org.jboss.jandex.DotName repeatableAnnotationName)
method - singleAnnotationName - repeatableAnnotationName - public static List<org.jboss.jandex.AnnotationInstance> getRepeatableAnnotation(org.jboss.jandex.ClassInfo clazz, org.jboss.jandex.DotName singleAnnotationName, org.jboss.jandex.DotName repeatableAnnotationName)
clazz - singleAnnotationName - repeatableAnnotationName - public static org.jboss.jandex.Type getMethodParameterType(org.jboss.jandex.MethodInfo method,
short position)
method - position - public static org.jboss.jandex.Type getRequestBodyParameterClassType(org.jboss.jandex.MethodInfo method)
method - public static JandexUtil.JaxRsParameterInfo getMethodParameterJaxRsInfo(org.jboss.jandex.MethodInfo method, int idx)
JandexUtil.JaxRsParameterInfo object
with the name and type of the param.method - idx - public static boolean isSimpleClassSchema(org.jboss.jandex.AnnotationInstance annotation)
annotation - public static boolean isSimpleArraySchema(org.jboss.jandex.AnnotationInstance annotation)
annotation - Copyright © 2018 JBoss by Red Hat. All rights reserved.