Class AnnotationManagerImpl
- java.lang.Object
-
- org.datanucleus.metadata.annotations.AnnotationManagerImpl
-
- All Implemented Interfaces:
AnnotationManager
public class AnnotationManagerImpl extends java.lang.Object implements AnnotationManager
Manager for annotations. Acts as a registry of the available annotation readers and allows use of all types of registered annotations.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Map<java.lang.String,java.lang.String>
annotationReaderLookup
Lookup of annotation reader name keyed by the annotation class name.(package private) java.util.Map<java.lang.String,AnnotationReader>
annotationReaders
Cache of the available annotation readers (keyed by the class name).(package private) java.util.Set<java.lang.String>
classAnnotationHandlerAnnotations
Set of (class) annotations that have handlers.(package private) java.util.Map<java.lang.String,ClassAnnotationHandler>
classAnnotationHandlers
Cache of ClassAnnotationHandler keyed by the annotation name that they handle.(package private) java.util.Set<java.lang.String>
memberAnnotationHandlerAnnotations
Set of (member) annotations that have handlers.(package private) java.util.Map<java.lang.String,MemberAnnotationHandler>
memberAnnotationHandlers
Cache of MemberAnnotationHandler keyed by the annotation name that they handle.protected MetaDataManager
metadataMgr
MetaData Manager that we work for.
-
Constructor Summary
Constructors Constructor Description AnnotationManagerImpl(MetaDataManager metadataMgr)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getClassAnnotationHasHandler(java.lang.String annotationName)
ClassAnnotationHandler
getHandlerForClassAnnotation(java.lang.String annotationName)
Accessor for a handler for the specified class annotation.MemberAnnotationHandler
getHandlerForMemberAnnotation(java.lang.String annotationName)
Accessor for a handler for the specified member annotation.boolean
getMemberAnnotationHasHandler(java.lang.String annotationName)
AbstractClassMetaData
getMetaDataForClass(java.lang.Class cls, PackageMetaData pmd, ClassLoaderResolver clr)
Accessor for the MetaData for the specified class, read from annotations.
-
-
-
Field Detail
-
metadataMgr
protected final MetaDataManager metadataMgr
MetaData Manager that we work for.
-
annotationReaderLookup
java.util.Map<java.lang.String,java.lang.String> annotationReaderLookup
Lookup of annotation reader name keyed by the annotation class name.
-
annotationReaders
java.util.Map<java.lang.String,AnnotationReader> annotationReaders
Cache of the available annotation readers (keyed by the class name).
-
classAnnotationHandlerAnnotations
java.util.Set<java.lang.String> classAnnotationHandlerAnnotations
Set of (class) annotations that have handlers.
-
classAnnotationHandlers
java.util.Map<java.lang.String,ClassAnnotationHandler> classAnnotationHandlers
Cache of ClassAnnotationHandler keyed by the annotation name that they handle.
-
memberAnnotationHandlerAnnotations
java.util.Set<java.lang.String> memberAnnotationHandlerAnnotations
Set of (member) annotations that have handlers.
-
memberAnnotationHandlers
java.util.Map<java.lang.String,MemberAnnotationHandler> memberAnnotationHandlers
Cache of MemberAnnotationHandler keyed by the annotation name that they handle.
-
-
Constructor Detail
-
AnnotationManagerImpl
public AnnotationManagerImpl(MetaDataManager metadataMgr)
Constructor.- Parameters:
metadataMgr
- Manager for MetaData
-
-
Method Detail
-
getMetaDataForClass
public AbstractClassMetaData getMetaDataForClass(java.lang.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
public boolean getClassAnnotationHasHandler(java.lang.String annotationName)
- Specified by:
getClassAnnotationHasHandler
in interfaceAnnotationManager
-
getMemberAnnotationHasHandler
public boolean getMemberAnnotationHasHandler(java.lang.String annotationName)
- Specified by:
getMemberAnnotationHasHandler
in interfaceAnnotationManager
-
getHandlerForClassAnnotation
public ClassAnnotationHandler getHandlerForClassAnnotation(java.lang.String annotationName)
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
public MemberAnnotationHandler getHandlerForMemberAnnotation(java.lang.String annotationName)
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
-
-