Top Description Constructors Methods
org.hibernate.annotations.common.annotationfactory

public final Class AnnotationFactory

extends Object
Class Inheritance
Imports
java.lang.annotation.Annotation, java.lang.reflect.Constructor, .InvocationHandler, .InvocationTargetException, .Proxy

Creates live annotations (actually AnnotationProxies) from AnnotationDescriptors.
Authors
Paolo Perrotta, Davide Marchignoli
See Also
AnnotationProxy

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static <T extends Annotation> T

Returns:

The annotation proxy
create
(AnnotationDescriptor
The annotation descriptor
descriptor
)

Creates an Annotation proxy for the given annotation descriptor.

public static <T extends Annotation> T

Returns:

The annotation proxy
create
(AnnotationDescriptor
The annotation descriptor
descriptor
,
ClassLoader
The ClassLoader to be used in defining the proxy
classLoader
)

Overloaded form of Annotation proxy creation that accepts an explicit ClassLoader.

public static <T extends Annotation> T

Returns:

The annotation proxy
createUsingTccl
(AnnotationDescriptor
The annotation descriptor
descriptor
)

Legacy form of {@link #create(AnnotationDescriptor) using the current Thread#getContextClassLoader for proxy generation

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AnnotationFactoryback to summary
public AnnotationFactory()

Method Detail

createback to summary
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:AnnotationDescriptor

The annotation descriptor

Returns:T

The annotation proxy

createback to summary
public static <T extends Annotation> T create(AnnotationDescriptor descriptor, ClassLoader classLoader)

Overloaded form of Annotation proxy creation that accepts an explicit ClassLoader.

Parameters
descriptor:AnnotationDescriptor

The annotation descriptor

classLoader:ClassLoader

The ClassLoader to be used in defining the proxy

Returns:T

The annotation proxy

Annotations
@SuppressWarnings:unchecked
createUsingTcclback to summary
public static <T extends Annotation> T createUsingTccl(AnnotationDescriptor descriptor)

Legacy form of {@link #create(AnnotationDescriptor) using the current Thread#getContextClassLoader for proxy generation

Parameters
descriptor:AnnotationDescriptor

The annotation descriptor

Returns:T

The annotation proxy