Author: shane.bryzak(a)jboss.com
Date: 2010-06-24 00:17:18 -0400 (Thu, 24 Jun 2010)
New Revision: 6576
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/properties/query/PropertyQuery.java
Log:
restrict query to accessor methods
Modified:
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/properties/query/PropertyQuery.java
===================================================================
---
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/properties/query/PropertyQuery.java 2010-06-24
01:25:21 UTC (rev 6575)
+++
extensions/trunk/src/main/java/org/jboss/weld/extensions/util/properties/query/PropertyQuery.java 2010-06-24
04:17:18 UTC (rev 6576)
@@ -43,15 +43,18 @@
{
List<Property<V>> results = new ArrayList<Property<V>>();
- // First check public methods (we ignore private methods)
+ // First check public accessor methods (we ignore private methods)
for (Method method : targetClass.getMethods())
{
+ if (!(method.getName().startsWith("is") ||
method.getName().startsWith("get"))) break;
+
boolean match = true;
for (PropertyCriteria c : criteria)
{
if (!c.methodMatches(method))
{
match = false;
+ break;
}
}
if (match) results.add(Properties.<V>createProperty(method));
@@ -69,6 +72,7 @@
if (!c.fieldMatches(field))
{
match = false;
+ break;
}
}
Property<V> prop = Properties.<V>createProperty(field);