public class AnnotationRepositoryImpl extends java.lang.Object implements AnnotationRepository
Constructor and Description |
---|
AnnotationRepositoryImpl(java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> annotationToClasses,
java.util.Map<java.lang.String,ClassInfo> classInfo,
Settings settings)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.util.Collection<Annotation> |
getAnnotation(java.lang.Class<?> annotation)
Get the instances of an annotation
|
java.util.Collection<Annotation> |
getAnnotation(java.lang.String annotation)
Get the instances of an annotation
|
java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Collection<java.lang.String>> |
getAnnotationToClasses()
Get the annotation to classes datastructure
|
java.util.Set<java.lang.String> |
getAvailableAnnotations()
Get the available annotation keys
|
java.util.concurrent.ConcurrentMap<java.lang.String,ClassInfo> |
getClassInfo()
Get the class information datastructure
|
int |
getSize()
Get the size of the repository
|
int |
getSize(java.lang.Class annotation)
Get the size of the repository
|
boolean |
hasAnnotation(java.lang.Class<?> annotation)
Does the repository contain references of the specified annotation
|
boolean |
hasAnnotation(java.lang.String annotation)
Does the repository contain references of the specified annotation
|
void |
merge(AnnotationRepository ar)
Merge an annotation repository
|
void |
registerAnnotation(java.lang.String clz,
java.lang.String key,
Annotation a)
Register an annotation on a class
|
void |
removeAllAnnotations()
Remove all annotations from the repository
|
void |
removeAnnotations(java.lang.String clz)
Remove annotations from the repository
|
Settings |
settings()
Get the settings for repository
|
boolean |
shouldBeScanned(java.lang.String clz)
Should the class in question be scanned ?
|
java.lang.String |
toString()
String representation
|
public AnnotationRepositoryImpl(java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> annotationToClasses, java.util.Map<java.lang.String,ClassInfo> classInfo, Settings settings)
annotationToClasses
- The annotation to classes mappingclassInfo
- The class information mapsettings
- The settings for the repositorypublic Settings settings()
settings
in interface AnnotationRepository
public java.util.Set<java.lang.String> getAvailableAnnotations()
getAvailableAnnotations
in interface AnnotationRepository
public boolean hasAnnotation(java.lang.Class<?> annotation)
hasAnnotation
in interface AnnotationRepository
annotation
- The annotation classpublic boolean hasAnnotation(java.lang.String annotation)
hasAnnotation
in interface AnnotationRepository
annotation
- The fully qualified class name for the annotationpublic java.util.Collection<Annotation> getAnnotation(java.lang.Class<?> annotation)
getAnnotation
in interface AnnotationRepository
annotation
- The annotation classnull
if no annotations existspublic java.util.Collection<Annotation> getAnnotation(java.lang.String annotation)
getAnnotation
in interface AnnotationRepository
annotation
- The fully qualified class name for the annotationnull
if no annotations existspublic void merge(AnnotationRepository ar)
merge
in interface AnnotationRepository
ar
- The annotation repositorypublic java.util.concurrent.ConcurrentMap<java.lang.String,java.util.Collection<java.lang.String>> getAnnotationToClasses()
public java.util.concurrent.ConcurrentMap<java.lang.String,ClassInfo> getClassInfo()
public int getSize()
public int getSize(java.lang.Class annotation)
annotation
- The annotation classpublic boolean shouldBeScanned(java.lang.String clz)
clz
- The fully qualified class namepublic void registerAnnotation(java.lang.String clz, java.lang.String key, Annotation a)
clz
- The fully qualified class namekey
- The fully qualified class name for the annotationa
- The annotationpublic void removeAllAnnotations()
public void removeAnnotations(java.lang.String clz)
clz
- The annotation classpublic java.lang.String toString()
toString
in class java.lang.Object
Copyright ? 2009 Red Hat Middleware LLC (http://www.jboss.com/)