java.lang.Object
org.hibernate.annotations.common.annotationfactory.AnnotationFactory

public final class AnnotationFactory extends Object
Creates live annotations (actually AnnotationProxies) from AnnotationDescriptors.
See Also:
  • Constructor Details

    • AnnotationFactory

      public AnnotationFactory()
  • Method Details

    • create

      public static <T extends Annotation> T create(AnnotationDescriptor descriptor)
      Creates an Annotation proxy for the given annotation descriptor.

      NOTE: the proxy here is generated using the ClassLoader of the Annotation type's Class. E.g., if asked to create an Annotation proxy for javax.persistence.Entity we would use the ClassLoader of the javax.persistence.Entity Class for generating the proxy.

      Parameters:
      descriptor - The annotation descriptor
      Returns:
      The annotation proxy
    • createUsingTccl

      public static <T extends Annotation> T createUsingTccl(AnnotationDescriptor descriptor)
      Parameters:
      descriptor - The annotation descriptor
      Returns:
      The annotation proxy
    • create

      public static <T extends Annotation> T create(AnnotationDescriptor descriptor, ClassLoader classLoader)
      Overloaded form of Annotation proxy creation that accepts an explicit ClassLoader.
      Parameters:
      descriptor - The annotation descriptor
      classLoader - The ClassLoader to be used in defining the proxy
      Returns:
      The annotation proxy