Class AnnotationUtils

java.lang.Object
com.ultikits.ultitools.utils.AnnotationUtils

public class AnnotationUtils extends Object
Utility class for annotation processing operations. Provides methods to find annotations on classes including inherited annotations.
Since:
6.0.0
Author:
wisdomme
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Private constructor to prevent instantiation.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends Annotation>
    T
    findAnnotation(Class<?> clazz, Class<T> annotationType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    This legacy lookup only walks one meta-annotation level and never merges @AliasFor overrides.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AnnotationUtils

      private AnnotationUtils()
      Private constructor to prevent instantiation.
  • Method Details

    • findAnnotation

      @Deprecated(since="6.3.0", forRemoval=true) public static <T extends Annotation> T findAnnotation(Class<?> clazz, Class<T> annotationType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This legacy lookup only walks one meta-annotation level and never merges @AliasFor overrides. Use MergedAnnotationResolver.find(java.lang.Class<?>, java.lang.Class<A>) instead, which walks the whole annotation tree and applies any @AliasFor override found along the way.
      Find an annotation on a class, searching up the inheritance hierarchy if not found directly.
      Type Parameters:
      T - the annotation type
      Parameters:
      clazz - the class to search for the annotation
      annotationType - the type of annotation to find
      Returns:
      the annotation if found, or null if not found
      Scheduled removal version:
      6.4.0