Class AnnotationUtils
java.lang.Object
org.ghotibeaun.json.converters.utils.AnnotationUtils
public class AnnotationUtils extends Object
-
Method Summary
Modifier and Type Method Description static <T extends Annotation>
Optional<T>findAnnotation(Class<? extends T> annotationClass, AnnotatedElement classMember)
Find and return an Optional containing an Annotationstatic Optional<String>
findJSONElementGetter(AnnotatedElement element)
static Optional<String>
findJSONElementKey(AnnotatedElement element)
static Optional<String>
findJSONElementSetter(AnnotatedElement element)
static boolean
findJSONIgnore(AnnotatedElement element)
static Optional<Class<?>>
findTargetClass(AnnotatedElement element)
static Optional<ValueConverter<?>>
getClassValueConverter(AnnotatedElement element)
static Optional<ValueConverter<?>>
getJSONValueConverter(AnnotatedElement element)
-
Method Details
-
findAnnotation
public static <T extends Annotation> Optional<T> findAnnotation(Class<? extends T> annotationClass, AnnotatedElement classMember)Find and return an Optional containing an Annotation- Type Parameters:
T
- The annotation type- Parameters:
annotationClass
- the annotation classclassMember
- The class member (either a Field, Method or Class)- Returns:
- an Optional containing the Annotation
-
getJSONValueConverter
public static Optional<ValueConverter<?>> getJSONValueConverter(AnnotatedElement element) throws JSONConversionException- Throws:
JSONConversionException
-
getClassValueConverter
public static Optional<ValueConverter<?>> getClassValueConverter(AnnotatedElement element) throws JSONConversionException- Throws:
JSONConversionException
-
findJSONIgnore
-
findJSONElementKey
-
findJSONElementSetter
-
findJSONElementGetter
-
findTargetClass
-