Author: swd847
Date: 2010-04-13 08:16:45 -0400 (Tue, 13 Apr 2010)
New Revision: 6099
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java
Log:
added getConstructors
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java
===================================================================
---
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java 2010-04-13
02:26:13 UTC (rev 6098)
+++
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/ReflectionUtils.java 2010-04-13
12:16:45 UTC (rev 6099)
@@ -115,4 +115,19 @@
}
return null;
}
+
+ public static Set<Constructor<?>> getConstructors(Class<?> clazz)
+ {
+ HashSet<Constructor<?>> ret = new HashSet();
+ Class<?> p = clazz;
+ while (p != null && p != Object.class)
+ {
+ for (Constructor<?> c : p.getDeclaredConstructors())
+ {
+ ret.add(c);
+ }
+ p = p.getSuperclass();
+ }
+ return ret;
+ }
}
Show replies by date