geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r502542 - /geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java
Date Fri, 02 Feb 2007 08:55:54 GMT
Author: dblevins
Date: Fri Feb  2 00:55:53 2007
New Revision: 502542

URL: http://svn.apache.org/viewvc?view=rev&rev=502542
Log:
method for checking the presence of annotations without loading classes.

Modified:
    geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java

Modified: geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java?view=diff&rev=502542&r1=502541&r2=502542
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/main/java/org/apache/xbean/finder/ClassFinder.java
Fri Feb  2 00:55:53 2007
@@ -31,8 +31,6 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.AnnotatedElement;
 import java.net.URL;
-import java.net.MalformedURLException;
-import java.net.URLConnection;
 import java.net.JarURLConnection;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -178,6 +176,11 @@
                 annotationInfos.add(info);
             }
         }
+    }
+
+    public boolean isAnnotationPresent(Class<? extends Annotation> annotation) {
+        List<Info> infos = annotated.get(annotation.getName());
+        return infos != null && !infos.isEmpty();
     }
 
     /**



Mime
View raw message