From: patriot1burke Date: Fri, 11 Jan 2008 13:49:08 +0000 (+0000) Subject: Added documentation X-Git-Tag: scannotation-1.0.4~8 X-Git-Url: https://juplo.de/gitweb/?p=scannotation;a=commitdiff_plain;h=868064416c672c93f8b0a1b5d7b6a170d2b0e7f3 Added documentation --- diff --git a/pom.xml b/pom.xml index 82486f4..4b32de2 100644 --- a/pom.xml +++ b/pom.xml @@ -56,6 +56,12 @@ 1.5 + + maven-site-plugin + + en + + diff --git a/src/main/java/org/scannotation/AnnotationDB.java b/src/main/java/org/scannotation/AnnotationDB.java index 35f3a8d..2c062f2 100644 --- a/src/main/java/org/scannotation/AnnotationDB.java +++ b/src/main/java/org/scannotation/AnnotationDB.java @@ -25,6 +25,15 @@ import java.util.Map; import java.util.Set; /** + * The class allows you to scan an arbitrary set of "archives" for .class files. These class files + * are parsed to see what annotations they use. Two indexes are created. + * + * One is a map of annotations and what classes + * use those annotations. This could be used, for example, by an EJB deployer to find all the EJBs contained + * in the archive + * + * Another is a mpa of classes and what annotations those classes use. + * * @author Bill Burke * @version $Revision: 1 $ */ @@ -102,31 +111,62 @@ public class AnnotationDB implements Serializable } + /** + * returns a map keyed by the fully qualified string name of a annotation class. The Set returne is + * a list of classes that use that annotation somehow. + * + */ public Map> getAnnotationIndex() { return annotationIndex; } + /** + * returns a map keyed by the list of classes scanned. The value set returned is a list of annotations + * used by that class. + * + */ public Map> getClassIndex() { return classIndex; } + + /** + * Whether or not you want AnnotationDB to scan for class level annotations + * + * @param scanClassAnnotations + */ public void setScanClassAnnotations(boolean scanClassAnnotations) { this.scanClassAnnotations = scanClassAnnotations; } + /** + * Wheter or not you want AnnotationDB to scan for method level annotations + * + * @param scanMethodAnnotations + */ public void setScanMethodAnnotations(boolean scanMethodAnnotations) { this.scanMethodAnnotations = scanMethodAnnotations; } + /** + * Whether or not you want AnnotationDB to scan for parameter level annotations + * + * @param scanParameterAnnotations + */ public void setScanParameterAnnotations(boolean scanParameterAnnotations) { this.scanParameterAnnotations = scanParameterAnnotations; } + /** + * Whether or not you want AnnotationDB to scan for parameter level annotations + * + * @param scanFieldAnnotations + */ public void setScanFieldAnnotations(boolean scanFieldAnnotations) { this.scanFieldAnnotations = scanFieldAnnotations; @@ -136,7 +176,7 @@ public class AnnotationDB implements Serializable /** * Scan a url that represents an "archive" this is a classpath directory or jar file * - * @param url + * @param urls variable list of URLs to scan as archives * @throws IOException */ public void scanArchives(URL... urls) throws IOException @@ -160,9 +200,9 @@ public class AnnotationDB implements Serializable } /** - * Can a .class file for annotations + * Parse a .class file for annotations * - * @param bits + * @param bits input stream pointing to .class file bits * @throws IOException */ public void scanClass(InputStream bits) throws IOException @@ -281,7 +321,12 @@ public class AnnotationDB implements Serializable } } - public void outputAnnotationDB(PrintWriter writer) + /** + * Prints out annotationIndex + * + * @param writer + */ + public void outputAnnotationIndex(PrintWriter writer) { for (String ann : annotationIndex.keySet()) {