Class AnnotationFunctions
java.lang.Object
org.eclipse.edc.plugins.autodoc.core.processor.compiler.AnnotationFunctions
Contains convenience methods for working with Java Compiler API annotation mirrors.
These methods delegate to SimpleAnnotationValueVisitor9 implementations to walk trees produced by the compiler and resolve requested values.
-
Method Summary
Modifier and TypeMethodDescriptionattributeStringValues(String name, AnnotationMirror annotationMirror, Elements elementUtils) Returns the annotation attribute value as a collection of strings.attributeTypeValues(String name, AnnotationMirror annotationMirror, Elements elementUtils) Returns the annotation attribute value as a collection of type names.static <T> TattributeValue(Class<T> type, String name, AnnotationMirror annotationMirror, Elements elementUtils) Returns the annotation attribute value of the given type and name.static @Nullable AnnotationMirrormirrorFor(Class<? extends Annotation> type, Element element) Returns the annotation mirror for the annotated element corresponding to the given annotation type, or null if no type is found.static TypeMirrormirrorForReturn(Element element) Returns the type mirror for a method's return type.
-
Method Details
-
mirrorFor
@Nullable public static @Nullable AnnotationMirror mirrorFor(Class<? extends Annotation> type, Element element) Returns the annotation mirror for the annotated element corresponding to the given annotation type, or null if no type is found. -
mirrorForReturn
Returns the type mirror for a method's return type. Assumes thatelementrefers to an executable type, most likely aType$MethodType -
attributeValue
public static <T> T attributeValue(Class<T> type, String name, AnnotationMirror annotationMirror, Elements elementUtils) Returns the annotation attribute value of the given type and name.- Parameters:
type- the value typename- the attribute nameannotationMirror- the annotationelementUtils- the current elements instance
-
attributeStringValues
public static List<String> attributeStringValues(String name, AnnotationMirror annotationMirror, Elements elementUtils) Returns the annotation attribute value as a collection of strings.- Parameters:
name- the attribute nameannotationMirror- the annotationelementUtils- the current elements instance
-
attributeTypeValues
public static List<String> attributeTypeValues(String name, AnnotationMirror annotationMirror, Elements elementUtils) Returns the annotation attribute value as a collection of type names.- Parameters:
name- the attribute nameannotationMirror- the annotationelementUtils- the current elements instance
-