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 MetaDataManagerMetaData Manager that we work for. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetClassAnnotationHasHandler(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.booleangetMemberAnnotationHasHandler(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
-
annotationReaders
Map<String, AnnotationReader> annotationReadersCache of the available annotation readers (keyed by the class name). -
classAnnotationHandlerAnnotations
-
classAnnotationHandlers
Map<String, ClassAnnotationHandler> classAnnotationHandlersCache of ClassAnnotationHandler keyed by the annotation name that they handle. -
memberAnnotationHandlerAnnotations
-
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:
getMetaDataForClassin interfaceAnnotationManager- Parameters:
cls- The classpmd- PackageMetaData to use as a parentclr- ClassLoader resolver- Returns:
- The ClassMetaData
-
getClassAnnotationHasHandler
- Specified by:
getClassAnnotationHasHandlerin interfaceAnnotationManager
-
getMemberAnnotationHasHandler
- Specified by:
getMemberAnnotationHasHandlerin interfaceAnnotationManager
-
getHandlerForClassAnnotation
Description copied from interface:AnnotationManagerAccessor for a handler for the specified class annotation.- Specified by:
getHandlerForClassAnnotationin 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:AnnotationManagerAccessor for a handler for the specified member annotation.- Specified by:
getHandlerForMemberAnnotationin interfaceAnnotationManager- Parameters:
annotationName- Annotation to be handled- Returns:
- The handler (if any). Takes the first one, so only register one handler
-