Author: manik.surtani(a)jboss.com
Date: 2007-11-27 13:59:02 -0500 (Tue, 27 Nov 2007)
New Revision: 4786
Modified:
core/trunk/src/main/java/org/jboss/cache/factories/XmlConfigurationParser.java
Log:
Extracted stuff into a util class
Modified: core/trunk/src/main/java/org/jboss/cache/factories/XmlConfigurationParser.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/factories/XmlConfigurationParser.java 2007-11-27
18:49:54 UTC (rev 4785)
+++
core/trunk/src/main/java/org/jboss/cache/factories/XmlConfigurationParser.java 2007-11-27
18:59:02 UTC (rev 4786)
@@ -21,6 +21,7 @@
import org.jboss.cache.config.MissingPolicyException;
import org.jboss.cache.eviction.EvictionPolicy;
import org.jboss.cache.util.Util;
+import org.jboss.cache.util.BeanUtils;
import org.jboss.cache.xml.XmlHelper;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
@@ -230,8 +231,8 @@
for (Entry entry : attribs.entrySet())
{
String propName = (String) entry.getKey();
- String setter = getSetterName(propName);
- Method method = null;
+ String setter = BeanUtils.setterName(propName);
+ Method method;
try
{
@@ -698,21 +699,6 @@
return new ParsedAttributes(stringAttribs, xmlAttribs);
}
-
- private static String getSetterName(String propName)
- {
- StringBuffer sb = new StringBuffer("set");
- if (propName != null && propName.length() > 0)
- {
- sb.append(propName.substring(0, 1).toUpperCase(Locale.ENGLISH));
- if (propName.length() > 1)
- {
- sb.append(propName.substring(1));
- }
- }
- return sb.toString();
- }
-
static class ParsedAttributes
{
Map<String, String> stringAttribs;