Package io.helidon.metadata.reflection
Class AnnotationFactory
java.lang.Object
io.helidon.metadata.reflection.AnnotationFactory
Reflection based handler of
Annotation and Annotation.-
Method Summary
Modifier and TypeMethodDescriptionstatic Annotationcreate(Annotation annotation) Create a Helidon annotation from Java annotation instance.static List<Annotation> create(AnnotatedElement annotated) Create Helidon annotations from Java annotated element (method, field, class).static <T extends Annotation>
Optional<T> synthesize(Annotation annotation) Creates an instance of the provided annotation using reflection (and proxying).
-
Method Details
-
create
Create Helidon annotations from Java annotated element (method, field, class).- Parameters:
annotated- annotated element to analyze- Returns:
- list of annotation instances
-
create
Create a Helidon annotation from Java annotation instance.- Parameters:
annotation- annotation to analyze- Returns:
- annotation instance
-
synthesize
Creates an instance of the provided annotation using reflection (and proxying). In case the annotation is not on the classpath, returns an empty optional.- Type Parameters:
T- type of the annotation- Parameters:
annotation- annotation to materialize- Returns:
- annotation instance, or empty option in case the annotation type is not on classpath
-