|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cruxframework.crux.scanner.AbstractScanner
org.cruxframework.crux.scanner.AnnotationDB
public class AnnotationDB
A class scanner that builds an index of classes by annotations and implemented interfaces. Based on Scannotation library from Bill Burke.
| Field Summary | |
|---|---|
protected Map<String,Set<String>> |
annotationIndex
|
protected Map<String,Set<String>> |
classIndex
|
protected Map<String,Set<String>> |
classInterfaces
|
protected Map<String,Set<String>> |
implementsIndex
|
protected Map<String,Set<String>> |
interfacesIndex
|
protected boolean |
scanFieldAnnotations
|
protected boolean |
scanMethodAnnotations
|
protected Set<URL> |
scannedURLs
|
protected boolean |
scanParameterAnnotations
|
protected Map<String,String> |
superClasses
|
| Constructor Summary | |
|---|---|
AnnotationDB()
|
|
| Method Summary | |
|---|---|
Map<String,Set<String>> |
getAnnotationIndex()
returns a map keyed by the fully qualified string name of a annotation class. |
Map<String,Set<String>> |
getClassIndex()
returns a map keyed by the list of classes scanned. |
protected Set<String> |
getInterfacesFromSuperClass(String className,
Set<String> processedClasses)
|
Map<String,Set<String>> |
getInterfacesIndex()
|
Scanners.ScannerCallback |
getScannerCallback()
|
Filter |
getScannerFilter()
|
void |
outputAnnotationIndex(PrintWriter writer)
Prints out annotationIndex |
protected void |
populate(javassist.bytecode.annotation.Annotation[] annotations,
String className)
|
protected void |
populateInterfaces(javassist.bytecode.ClassFile cf)
|
protected void |
populateInterfaces(String[] interfaces,
String className)
|
protected void |
populateInterfacesFromSuperClass()
|
void |
resetScanner()
|
void |
scanArchives()
Scan a url that represents an "archive" this is a classpath directory or jar file |
protected void |
scanClass(javassist.bytecode.ClassFile cf)
|
void |
scanClass(InputStream bits)
Parse a .class file for annotations |
protected void |
scanFields(javassist.bytecode.ClassFile cf)
|
protected void |
scanMethods(javassist.bytecode.ClassFile cf)
Scanns both the method and its parameters for annotations. |
void |
setScanFieldAnnotations(boolean scanFieldAnnotations)
Whether or not you want AnnotationDB to scan for parameter level annotations |
void |
setScanMethodAnnotations(boolean scanMethodAnnotations)
Wheter or not you want AnnotationDB to scan for method level annotations |
void |
setScanParameterAnnotations(boolean scanParameterAnnotations)
Whether or not you want AnnotationDB to scan for parameter level annotations |
| Methods inherited from class org.cruxframework.crux.scanner.AbstractScanner |
|---|
runScanner |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map<String,Set<String>> annotationIndex
protected Map<String,Set<String>> implementsIndex
protected Map<String,Set<String>> classIndex
protected Set<URL> scannedURLs
protected Map<String,Set<String>> interfacesIndex
protected Map<String,String> superClasses
protected Map<String,Set<String>> classInterfaces
protected transient boolean scanMethodAnnotations
protected transient boolean scanParameterAnnotations
protected transient boolean scanFieldAnnotations
| Constructor Detail |
|---|
public AnnotationDB()
| Method Detail |
|---|
public Map<String,Set<String>> getAnnotationIndex()
public Map<String,Set<String>> getClassIndex()
public Map<String,Set<String>> getInterfacesIndex()
public void setScanMethodAnnotations(boolean scanMethodAnnotations)
scanMethodAnnotations - public void setScanParameterAnnotations(boolean scanParameterAnnotations)
scanParameterAnnotations - public void setScanFieldAnnotations(boolean scanFieldAnnotations)
scanFieldAnnotations - public Filter getScannerFilter()
getScannerFilter in class AbstractScannerpublic Scanners.ScannerCallback getScannerCallback()
getScannerCallback in class AbstractScannerpublic void scanArchives()
urls - variable list of URLs to scan as archivespublic void resetScanner()
resetScanner in class AbstractScanner
public void scanClass(InputStream bits)
throws IOException
bits - input stream pointing to .class file bits
IOExceptionprotected void populateInterfaces(javassist.bytecode.ClassFile cf)
protected void populateInterfaces(String[] interfaces,
String className)
protected void populateInterfacesFromSuperClass()
protected Set<String> getInterfacesFromSuperClass(String className,
Set<String> processedClasses)
protected void scanClass(javassist.bytecode.ClassFile cf)
protected void scanMethods(javassist.bytecode.ClassFile cf)
cf - protected void scanFields(javassist.bytecode.ClassFile cf)
protected void populate(javassist.bytecode.annotation.Annotation[] annotations,
String className)
public void outputAnnotationIndex(PrintWriter writer)
writer -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||