Author: sebb
Date: Sat Sep 19 23:59:05 2009
New Revision: 816969
URL: http://svn.apache.org/viewvc?rev=816969&view=rev
Log:
Add convenience method findAnnotatedClasses(String[], Class)
Modified:
jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java
Modified:
jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java?rev=816969&r1=816968&r2=816969&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java
(original)
+++
jakarta/jmeter/trunk/src/jorphan/org/apache/jorphan/reflect/ClassFinder.java
Sat Sep 19 23:59:05 2009
@@ -228,6 +228,21 @@
/**
* Find classes in the provided path(s)/jar(s) that extend the class(es).
+ * Inner classes are not searched.
+ *
+ * @param strPathsOrJars - pathnames or jarfiles to search for classes
+ * @param annotations - required annotations
+ *
+ * @return List containing discovered classes
+ */
+ public static List<String> findAnnotatedClasses(String[] strPathsOrJars,
+ final Class<? extends Annotation>[] annotations)
+ throws IOException {
+ return findClassesThatExtend(strPathsOrJars, annotations, false, null,
null, true);
+ }
+
+ /**
+ * Find classes in the provided path(s)/jar(s) that extend the class(es).
* @param strPathsOrJars - pathnames or jarfiles to search for classes
* @param classNames - required parent class(es) or annotations
* @param innerClasses - should we include inner classes?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]