public class AnnotationDB extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
AnnotationDB.CrossReferenceException |
| Constructor and Description |
|---|
AnnotationDB() |
| Modifier and Type | Method and Description |
|---|---|
void |
addIgnoredPackages(String... ignored) |
void |
crossReferenceMetaAnnotations()
This method will cross reference annotations in the annotation index with any meta-annotations that they have
and create additional entries as needed.
|
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.
|
String[] |
getIgnoredPackages() |
void |
outputAnnotationIndex(PrintWriter writer)
Prints out annotationIndex
|
protected void |
populate(javassist.bytecode.annotation.Annotation[] annotations,
String className) |
void |
scanArchives(String... urls)
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 |
setIgnoredPackages(String[] ignoredPackages)
Override/overwrite any ignored packages
|
void |
setScanClassAnnotations(boolean scanClassAnnotations)
Whether or not you want AnnotationDB to scan for class level 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
|
public String[] getIgnoredPackages()
public void setIgnoredPackages(String[] ignoredPackages)
ignoredPackages - cannot be nullpublic void addIgnoredPackages(String... ignored)
public void crossReferenceMetaAnnotations()
throws AnnotationDB.CrossReferenceException
public Map<String,Set<String>> getAnnotationIndex()
public Map<String,Set<String>> getClassIndex()
public void setScanClassAnnotations(boolean scanClassAnnotations)
scanClassAnnotations - public void setScanMethodAnnotations(boolean scanMethodAnnotations)
scanMethodAnnotations - public void setScanParameterAnnotations(boolean scanParameterAnnotations)
scanParameterAnnotations - public void setScanFieldAnnotations(boolean scanFieldAnnotations)
scanFieldAnnotations - public void scanArchives(String... urls) throws IOException
urls - variable list of URLs to scan as archivesIOExceptionpublic void scanClass(InputStream bits) throws IOException
bits - input stream pointing to .class file bitsIOExceptionprotected 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 - Copyright © 2008-2013 The Apache Software Foundation. All Rights Reserved.