public interface ElementUtil
| 限定符和类型 | 方法和说明 |
|---|---|
static java.util.stream.Stream<TypeElement> |
getAllSubClasses(Types types,
Element root,
TypeMirror type) |
static java.util.stream.Stream<TypeElement> |
getAllSubClasses(Types types,
RoundEnvironment env,
TypeMirror type) |
static <T extends Annotation> |
getAnnotationClassValue(Elements elements,
T anno,
java.util.function.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 <T extends Annotation> TypeMirror getAnnotationClassValue(Elements elements, T anno, java.util.function.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 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 java.util.stream.Stream<TypeElement> getAllSubClasses(Types types, RoundEnvironment env, TypeMirror type)
static java.util.stream.Stream<TypeElement> getAllSubClasses(Types types, Element root, TypeMirror type)
Copyright © 2018. All rights reserved.