Class AnnotationFactory

java.lang.Object
io.helidon.metadata.reflection.AnnotationFactory

public final class AnnotationFactory extends Object
Reflection based handler of Annotation and Annotation.
  • Method Details

    • create

      public static List<Annotation> create(AnnotatedElement annotated)
      Create Helidon annotations from Java annotated element (method, field, class).
      Parameters:
      annotated - annotated element to analyze
      Returns:
      list of annotation instances
    • create

      public static Annotation create(Annotation annotation)
      Create a Helidon annotation from Java annotation instance.
      Parameters:
      annotation - annotation to analyze
      Returns:
      annotation instance
    • synthesize

      public static <T extends Annotation> Optional<T> synthesize(Annotation annotation)
      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