public class JandexUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JandexUtil.JaxRsParameterInfo
Deprecated.
|
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)
Reads a Boolean property from the given annotation instance.
|
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 org.jboss.jandex.AnnotationInstance |
getMethodParameterAnnotation(org.jboss.jandex.MethodInfo method,
int parameterIndex,
org.jboss.jandex.DotName annotationName)
Finds an annotation (if present) with the given name, on a particular parameter of a
method.
|
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 org.jboss.jandex.Type |
getMethodParameterType(org.jboss.jandex.MethodParameterInfo parameter)
Returns the class type of the method parameter.
|
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,
List<AnnotationScannerExtension> extensions)
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.
|
static <T> T |
value(org.jboss.jandex.AnnotationInstance annotation,
String name)
Convenience method to retrieve the named parameter from an annotation.
|
public static String refValue(org.jboss.jandex.AnnotationInstance annotation, JandexUtil.RefType refType)
annotation - AnnotationInstancerefType - RefTypepublic static <T> T value(org.jboss.jandex.AnnotationInstance annotation,
String name)
AnnotationValue.T - the type of the parameter being retrievedannotation - the annotation from which to fetch the parametername - the name of the parameterpublic static String stringValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
annotation - AnnotationInstancepropertyName - Stringpublic static Boolean booleanValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
annotation - AnnotationInstancepropertyName - Stringpublic static Boolean booleanValueWithDefault(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
annotation - AnnotationInstancepropertyName - Stringpublic static BigDecimal bigDecimalValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
annotation - AnnotationInstancepropertyName - Stringpublic static Integer intValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
annotation - AnnotationInstancepropertyName - Stringpublic static List<String> stringListValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName)
annotation - AnnotationInstancepropertyName - Stringpublic static <T extends Enum> T enumValue(org.jboss.jandex.AnnotationInstance annotation, String propertyName, Class<T> clazz)
T - Type parameterannotation - AnnotationInstancepropertyName - Stringclazz - Class type of the Enumpublic static boolean isRef(org.jboss.jandex.AnnotationInstance annotation)
annotation - AnnotationInstancepublic static boolean isEmpty(org.jboss.jandex.AnnotationInstance annotation)
annotation - AnnotationInstancepublic static org.jboss.jandex.AnnotationInstance getClassAnnotation(org.jboss.jandex.ClassInfo ct,
org.jboss.jandex.DotName name)
ct - ClassInfoname - DotNamepublic static Collection<org.jboss.jandex.ClassInfo> getJaxRsResourceClasses(org.jboss.jandex.IndexView index)
index - IndexViewpublic static List<org.jboss.jandex.AnnotationInstance> getParameterAnnotations(org.jboss.jandex.MethodInfo method, short paramPosition)
method - MethodInfoparamPosition - parameter positionpublic static String nameFromRef(org.jboss.jandex.AnnotationInstance annotation)
annotation - AnnotationInstancepublic static List<org.jboss.jandex.AnnotationInstance> getRepeatableAnnotation(org.jboss.jandex.MethodInfo method, org.jboss.jandex.DotName singleAnnotationName, org.jboss.jandex.DotName repeatableAnnotationName)
method - MethodInfosingleAnnotationName - DotNamerepeatableAnnotationName - DotNamepublic static List<org.jboss.jandex.AnnotationInstance> getRepeatableAnnotation(org.jboss.jandex.ClassInfo clazz, org.jboss.jandex.DotName singleAnnotationName, org.jboss.jandex.DotName repeatableAnnotationName)
clazz - ClassInfosingleAnnotationName - DotNamerepeatableAnnotationName - DotNamepublic static org.jboss.jandex.Type getMethodParameterType(org.jboss.jandex.MethodInfo method,
short position)
method - MethodInfoposition - parameter positionpublic static org.jboss.jandex.Type getMethodParameterType(org.jboss.jandex.MethodParameterInfo parameter)
parameter - the parameterpublic static org.jboss.jandex.Type getRequestBodyParameterClassType(org.jboss.jandex.MethodInfo method,
List<AnnotationScannerExtension> extensions)
method - MethodInfoextensions - available extensionspublic static org.jboss.jandex.AnnotationInstance getMethodParameterAnnotation(org.jboss.jandex.MethodInfo method,
int parameterIndex,
org.jboss.jandex.DotName annotationName)
method - parameterIndex - annotationName - public static boolean isSimpleClassSchema(org.jboss.jandex.AnnotationInstance annotation)
annotation - AnnotationInstancepublic static boolean isSimpleArraySchema(org.jboss.jandex.AnnotationInstance annotation)
annotation - AnnotationInstanceCopyright © 2018–2019. All rights reserved.