public interface ElementUtil
| Modifier and Type | Method and Description |
|---|---|
static Stream<TypeElement> |
getAllSubClasses(Types types,
Element root,
TypeMirror type) |
static Stream<TypeElement> |
getAllSubClasses(Types types,
RoundEnvironment env,
TypeMirror type) |
static <T extends Annotation> |
getAnnotationClassArray(Elements elements,
T anno,
Function<T,Class<?>[]> func) |
static <T extends Annotation> |
getAnnotationClassValue(Elements elements,
T anno,
Function<T,Class<?>> func)
For Class attribute, if we invoke directly, it will throw
MirroredTypeException. |
static Optional<AnnotationMirror> |
getAnnotationMirror(Element element,
Class<? extends Annotation> annotationClass)
Get
AnnotationMirror from given element with given type |
static Optional<AnnotationMirror> |
getAnnotationMirror(Element element,
String annoClzCanonicalName)
Get
AnnotationMirror from given element with given annotation name |
static Optional<AnnotationMirror> |
getAnnotationMirror(Element element,
TypeMirror annotationType)
Get
AnnotationMirror from given element with given type |
static List<? extends AnnotationMirror> |
getInheritAnnotationMirrors(TypeElement element,
Types types) |
static boolean |
isInherit(DeclaredType annoType) |
static <T extends Annotation> TypeMirror getAnnotationClassValue(Elements elements, T anno, Function<T,Class<?>> func)
MirroredTypeException. Use this method to get the Class value
safely.elements - Elements for convert Class to TypeMirroranno - annotation objectfunc - the invocation of get Class valueTypeMirrorstatic <T extends Annotation> List<TypeMirror> getAnnotationClassArray(Elements elements, T anno, Function<T,Class<?>[]> func)
static Optional<AnnotationMirror> getAnnotationMirror(Element element, Class<? extends Annotation> annotationClass)
AnnotationMirror from given element with given typeelement - the element to find annotationannotationClass - the annotation classstatic Optional<AnnotationMirror> getAnnotationMirror(Element element, TypeMirror annotationType)
AnnotationMirror from given element with given typeelement - the element to find annotationannotationType - the annotation TypeMirrorstatic Optional<AnnotationMirror> getAnnotationMirror(Element element, String annoClzCanonicalName)
AnnotationMirror from given element with given annotation nameelement - the element to find annotationannoClzCanonicalName - the annotation namestatic List<? extends AnnotationMirror> getInheritAnnotationMirrors(TypeElement element, Types types)
static boolean isInherit(DeclaredType annoType)
static Stream<TypeElement> getAllSubClasses(Types types, RoundEnvironment env, TypeMirror type)
static Stream<TypeElement> getAllSubClasses(Types types, Element root, TypeMirror type)
Copyright © 2018. All rights reserved.