You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by am...@apache.org on 2010/08/30 14:14:36 UTC
svn commit: r990778 - in
/axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils:
BeanUtil.java ConverterUtil.java
Author: amilas
Date: Mon Aug 30 12:14:36 2010
New Revision: 990778
URL: http://svn.apache.org/viewvc?rev=990778&view=rev
Log:
getting java objects even if the case does not match. this is use full when using benaUtils to get java object from xml files.
Modified:
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Modified: axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=990778&r1=990777&r2=990778&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original)
+++ axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Mon Aug 30 12:14:36 2010
@@ -338,7 +338,21 @@ public class BeanUtil {
} else if ("java.lang.Object".equals(beanClass.getName())){
return beanElement.getFirstOMChild();
}
- HashMap properties = new HashMap();
+
+ //use a comaprator to ignore the case of the bean element
+ //names eg. if the property descriptor is getServiceName it
+ //should accept child element with ServiceName as well.
+ //but currently accepts only serviceName
+ Comparator comparator = new Comparator() {
+ public int compare(Object o1, Object o2) {
+ String string1 = (String) o1;
+ String string2 = (String) o2;
+ return string1.compareToIgnoreCase(string2);
+ }
+ };
+ Map properties = new TreeMap(comparator);
+
+
BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
PropertyDescriptor [] propDescs = beanInfo.getPropertyDescriptors();
for (PropertyDescriptor proprty : propDescs) {
Modified: axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?rev=990778&r1=990777&r2=990778&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (original)
+++ axis/axis2/java/core/trunk/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java Mon Aug 30 12:14:36 2010
@@ -1330,6 +1330,10 @@ public class ConverterUtil {
return calendar.getTimeInMillis() - newCalendar.getTimeInMillis();
}
+ public static long compare(UnsignedLong unsignedLong, String value) {
+ return compare(unsignedLong.longValue(), value);
+ }
+
/**
* Converts the given .datahandler to a string
*