axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r524034 - in /webservices/axis2/branches/java/1_2/modules: adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java
Date Fri, 30 Mar 2007 10:41:32 GMT
Author: deepal
Date: Fri Mar 30 03:41:24 2007
New Revision: 524034

URL: http://svn.apache.org/viewvc?view=rev&rev=524034
Log:
applied the patch in AXIS2-2253

Modified:
    webservices/axis2/branches/java/1_2/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
    webservices/axis2/branches/java/1_2/modules/java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java

Modified: webservices/axis2/branches/java/1_2/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java?view=diff&rev=524034&r1=524033&r2=524034
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/adb/src/org/apache/axis2/databinding/typemapping/SimpleTypeMapper.java
Fri Mar 30 03:41:24 2007
@@ -52,6 +52,20 @@
     private static final String FLOAT = "float";
     private static final String CHAR = "char";
 
+    /*
+     * To support deserialize BigDecimal, BigInteger
+     * Day, Duration, Month, MonthDay, Time, Year, YearMonth
+     */
+    private static final String BIG_DECIMAL = "java.math.BigDecimal";
+    private static final String BIG_INTEGER = "java.math.BigInteger";
+    private static final String DAY = "org.apache.axis2.databinding.types.Day";
+    private static final String DURATION = "org.apache.axis2.databinding.types.Duration";
+    private static final String MONTH = "org.apache.axis2.databinding.types.Month";
+    private static final String MONTH_DAY = "org.apache.axis2.databinding.types.MonthDay";
+    private static final String TIME = "org.apache.axis2.databinding.types.Time";
+    private static final String YEAR = "org.apache.axis2.databinding.types.Year";
+    private static final String YEAR_MONTH = "org.apache.axis2.databinding.types.YearMonth";
+
     public static Object getSimpleTypeObject(Class parameter, OMElement value) {
         String name = parameter.getName();
         String text = value.getText();
@@ -96,7 +110,37 @@
             return makeCalendar(text, false);
         } else if (name.equals(W_DATE)) {
             return makeCalendar(text, true);
-        } else {
+        }/*
+         * return the correpsonding object for adding data type
+         */
+        else if(name.equals(BIG_DECIMAL)) {
+        	return new java.math.BigDecimal(text);
+        }
+        else if(name.equals(BIG_INTEGER)) {
+        	return new java.math.BigInteger(text);
+        }
+        else if(name.equals(DAY)) {
+        	return new org.apache.axis2.databinding.types.Day(text);
+        }
+        else if(name.equals(DURATION)) {
+        	return new org.apache.axis2.databinding.types.Duration(text);
+        }
+        else if(name.equals(MONTH)) {
+        	return new org.apache.axis2.databinding.types.Month(text);
+        }
+        else if(name.equals(MONTH_DAY)) {
+        	return new org.apache.axis2.databinding.types.MonthDay(text);
+        }
+        else if(name.equals(TIME)) {
+        	return new org.apache.axis2.databinding.types.Time(text);
+        }
+        else if(name.equals(YEAR)) {
+        	return new org.apache.axis2.databinding.types.Year(text);
+        }
+        else if(name.equals(YEAR_MONTH)) {
+        	return new org.apache.axis2.databinding.types.YearMonth(text);
+        }
+        else {
             return null;
         }
     }
@@ -194,7 +238,23 @@
             return true;
         } else if (objClassName.equals(W_DATE)) {
             return true;
-        } else {
+        } /*
+         * consider BigDecimal, BigInteger, Day, Duration, Month
+         * MonthDay, Time, Year, YearMonth as simple type
+         */
+        else if(objClassName.equals(BIG_DECIMAL)
+        		|| objClassName.equals(BIG_INTEGER)
+        		|| objClassName.equals(DAY)
+        		|| objClassName.equals(DURATION)
+        		|| objClassName.equals(MONTH)
+        		|| objClassName.equals(MONTH_DAY)
+        		|| objClassName.equals(TIME)
+        		|| objClassName.equals(YEAR)
+        		|| objClassName.equals(YEAR_MONTH))
+        {
+        	return true;
+        }
+        else {
             return objClassName.equals(W_CHAR);
         }
     }

Modified: webservices/axis2/branches/java/1_2/modules/java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_2/modules/java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java?view=diff&rev=524034&r1=524033&r2=524034
==============================================================================
--- webservices/axis2/branches/java/1_2/modules/java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java
(original)
+++ webservices/axis2/branches/java/1_2/modules/java2wsdl/src/org/apache/ws/java2wsdl/utils/TypeTable.java
Fri Mar 30 03:41:24 2007
@@ -79,6 +79,27 @@
         simpleTypetoxsd.put("java.util.Calendar",
                 new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "dateTime", "xs"));
 
+         //consider BigDecimal, BigInteger, Day, Duration, Month, MonthDay,
+        //Time, Year, YearMonth as SimpleType as well
+        simpleTypetoxsd.put("java.math.BigDecimal",
+                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "decimal", "xs"));
+        simpleTypetoxsd.put("java.math.BigInteger",
+                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "integer", "xs"));
+        simpleTypetoxsd.put("org.apache.axis2.databinding.types.Day",
+                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "gDay", "xs"));
+        simpleTypetoxsd.put("org.apache.axis2.databinding.types.Duration",
+                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "duration", "xs"));
+        simpleTypetoxsd.put("org.apache.axis2.databinding.types.Month",
+                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "gMonth", "xs"));
+        simpleTypetoxsd.put("org.apache.axis2.databinding.types.MonthDay",
+                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "gMonthDay", "xs"));
+        simpleTypetoxsd.put("org.apache.axis2.databinding.types.Time",
+                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "time", "xs"));
+        simpleTypetoxsd.put("org.apache.axis2.databinding.types.Year",
+                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "gYear", "xs"));
+        simpleTypetoxsd.put("org.apache.axis2.databinding.types.YearMonth",
+                new QName(Java2WSDLConstants.URI_2001_SCHEMA_XSD, "gYearMonth", "xs")); 
     
+
         simpleTypetoxsd.put("java.lang.Object",
                 ANY_TYPE);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message