Class AnnotationManagerImpl
java.lang.Object
org.datanucleus.metadata.annotations.AnnotationManagerImpl
- All Implemented Interfaces:
AnnotationManager
Manager for annotations.
Acts as a registry of the available annotation readers and allows use of all types of registered annotations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionLookup of annotation reader name keyed by the annotation class name.(package private) Map
<String, AnnotationReader> Cache of the available annotation readers (keyed by the class name).Set of (class) annotations that have handlers.(package private) Map
<String, ClassAnnotationHandler> Cache of ClassAnnotationHandler keyed by the annotation name that they handle.Set of (member) annotations that have handlers.(package private) Map
<String, MemberAnnotationHandler> Cache of MemberAnnotationHandler keyed by the annotation name that they handle.protected final MetaDataManager
MetaData Manager that we work for. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getClassAnnotationHasHandler
(String annotationName) getHandlerForClassAnnotation
(String annotationName) Accessor for a handler for the specified class annotation.getHandlerForMemberAnnotation
(String annotationName) Accessor for a handler for the specified member annotation.boolean
getMemberAnnotationHasHandler
(String annotationName) getMetaDataForClass
(Class cls, PackageMetaData pmd, ClassLoaderResolver clr) Accessor for the MetaData for the specified class, read from annotations.
-
Field Details
-
metadataMgr
MetaData Manager that we work for. -
annotationReaderLookup
Lookup of annotation reader name keyed by the annotation class name. -
annotationReaders
Map<String,AnnotationReader> annotationReadersCache of the available annotation readers (keyed by the class name). -
classAnnotationHandlerAnnotations
Set of (class) annotations that have handlers. -
classAnnotationHandlers
Map<String,ClassAnnotationHandler> classAnnotationHandlersCache of ClassAnnotationHandler keyed by the annotation name that they handle. -
memberAnnotationHandlerAnnotations
Set of (member) annotations that have handlers. -
memberAnnotationHandlers
Map<String,MemberAnnotationHandler> memberAnnotationHandlersCache of MemberAnnotationHandler keyed by the annotation name that they handle.
-
-
Constructor Details
-
AnnotationManagerImpl
Constructor.- Parameters:
metadataMgr
- Manager for MetaData
-
-
Method Details
-
getMetaDataForClass
public AbstractClassMetaData getMetaDataForClass(Class cls, PackageMetaData pmd, ClassLoaderResolver clr) Accessor for the MetaData for the specified class, read from annotations. The annotations can be of any supported type.- Specified by:
getMetaDataForClass
in interfaceAnnotationManager
- Parameters:
cls
- The classpmd
- PackageMetaData to use as a parentclr
- ClassLoader resolver- Returns:
- The ClassMetaData
-
getClassAnnotationHasHandler
- Specified by:
getClassAnnotationHasHandler
in interfaceAnnotationManager
-
getMemberAnnotationHasHandler
- Specified by:
getMemberAnnotationHasHandler
in interfaceAnnotationManager
-
getHandlerForClassAnnotation
Description copied from interface:AnnotationManager
Accessor for a handler for the specified class annotation.- Specified by:
getHandlerForClassAnnotation
in interfaceAnnotationManager
- Parameters:
annotationName
- Annotation to be handled.- Returns:
- The handler (if any). Takes the first one, so only register one handler
-
getHandlerForMemberAnnotation
Description copied from interface:AnnotationManager
Accessor for a handler for the specified member annotation.- Specified by:
getHandlerForMemberAnnotation
in interfaceAnnotationManager
- Parameters:
annotationName
- Annotation to be handled- Returns:
- The handler (if any). Takes the first one, so only register one handler
-