public abstract class AbstractAnnotationReader extends Object implements AnnotationReader
Each annotation reader supports a set of annotations. So it could support "JPA" annotations, or "JDO" annotations, or "DataNucleus" annotations or whatever.
Modifier and Type | Field and Description |
---|---|
protected MetaDataManager |
mmgr
Manager for MetaData operations
|
protected Set<String> |
supportedDuplicateAnnotations
Supported annotations that can be duplicated (when used in meta-annotations).
|
protected String[] |
supportedPackages
Supported annotations packages.
|
Constructor and Description |
---|
AbstractAnnotationReader(MetaDataManager mgr)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addSupportedDuplicateAnnotations(String annot) |
protected AnnotationObject[] |
getAnnotationObjectsForAnnotations(String clsName,
Annotation[] annotations)
Convenience method to convert an array of Annotation objects into an array of AnnotationObjects.
|
protected AnnotationObject[] |
getClassAnnotationsForClass(Class cls)
Method returning the annotations for the class.
|
protected Collection<org.datanucleus.metadata.annotations.AnnotatedMember> |
getFieldAnnotationsForClass(Class cls)
Method returning a Collection of the annotated fields for the specified class.
|
protected Collection<org.datanucleus.metadata.annotations.AnnotatedMember> |
getJavaBeanAccessorAnnotationsForClass(Class cls)
Method returning a Map containing an array of the annotations for each Java Bean accessor method of the passed class, keyed by the method name.
|
AbstractClassMetaData |
getMetaDataForClass(Class cls,
PackageMetaData pmd,
ClassLoaderResolver clr)
Accessor for the ClassMetaData for the specified class from its annotations.
|
String[] |
getSupportedAnnotationPackages()
Method to set the valid annotation packages to be supported when reading.
|
boolean |
isPersistenceContext()
Method to return whether this is reading in a persistence context.
|
protected boolean |
isSupportedAnnotation(String annotationClassName)
Convenience method to check whether an annotation class name is supported by this reader.
|
protected abstract AbstractClassMetaData |
processClassAnnotations(PackageMetaData pmd,
Class cls,
AnnotationObject[] annotations,
ClassLoaderResolver clr)
Method to process the "class" level annotations and create the outline ClassMetaData object.
|
protected abstract AbstractMemberMetaData |
processMemberAnnotations(AbstractClassMetaData cmd,
Member member,
AnnotationObject[] annotations)
Method to take the passed in outline ClassMetaData and process the annotations for fields/properties adding any necessary FieldMetaData/PropertyMetaData to the ClassMetaData.
|
protected abstract void |
processMethodAnnotations(AbstractClassMetaData cmd,
Method method)
Method to take the passed in outline ClassMetaData and process the annotations for method adding any necessary MetaData to the ClassMetaData.
|
protected void |
setSupportedAnnotationPackages(String[] packages)
Method to set the valid annotation packages to be supported when reading.
|
protected MetaDataManager mmgr
protected String[] supportedPackages
public AbstractAnnotationReader(MetaDataManager mgr)
mgr
- MetaData managerpublic boolean isPersistenceContext()
AnnotationReader
isPersistenceContext
in interface AnnotationReader
public String[] getSupportedAnnotationPackages()
getSupportedAnnotationPackages
in interface AnnotationReader
protected void setSupportedAnnotationPackages(String[] packages)
packages
- The supported packages.protected void addSupportedDuplicateAnnotations(String annot)
protected boolean isSupportedAnnotation(String annotationClassName)
annotationClassName
- Name of the annotation classpublic AbstractClassMetaData getMetaDataForClass(Class cls, PackageMetaData pmd, ClassLoaderResolver clr)
getMetaDataForClass
in interface AnnotationReader
cls
- The classpmd
- MetaData for the owning packageclr
- ClassLoader resolverprotected abstract AbstractClassMetaData processClassAnnotations(PackageMetaData pmd, Class cls, AnnotationObject[] annotations, ClassLoaderResolver clr)
pmd
- Parent PackageMetaDatacls
- The classannotations
- Annotations for the classclr
- ClassLoader resolverprotected abstract AbstractMemberMetaData processMemberAnnotations(AbstractClassMetaData cmd, Member member, AnnotationObject[] annotations)
cmd
- The ClassMetaData (to be updated)member
- The field/property being processedannotations
- The annotations for this field/propertyprotected abstract void processMethodAnnotations(AbstractClassMetaData cmd, Method method)
cmd
- The ClassMetaData (to be updated)method
- The methodprotected AnnotationObject[] getClassAnnotationsForClass(Class cls)
cls
- The classprotected Collection<org.datanucleus.metadata.annotations.AnnotatedMember> getJavaBeanAccessorAnnotationsForClass(Class cls)
cls
- The classprotected Collection<org.datanucleus.metadata.annotations.AnnotatedMember> getFieldAnnotationsForClass(Class cls)
cls
- The classprotected AnnotationObject[] getAnnotationObjectsForAnnotations(String clsName, Annotation[] annotations)
clsName
- Name of the classannotations
- The annotationsCopyright © 2019. All rights reserved.