axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r367984 - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java codegen/src/org/apache/axis2/schema/SchemaConstants.java
Date Wed, 11 Jan 2006 09:29:19 GMT
Author: ajith
Date: Wed Jan 11 01:29:08 2006
New Revision: 367984

URL: http://svn.apache.org/viewcvs?rev=367984&view=rev
Log:
A last minute change to the ConverterUtil.java to handle anytype
Also refactored one of the constants for clarity

Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaConstants.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?rev=367984&r1=367983&r2=367984&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Wed Jan 11 01:29:08 2006
@@ -30,9 +30,17 @@
 import org.apache.axis2.databinding.types.UnsignedShort;
 import org.apache.axis2.databinding.types.Year;
 import org.apache.axis2.databinding.types.YearMonth;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.OMFactory;
+import org.apache.axis2.om.OMAbstractFactory;
+import org.apache.axis2.om.OMNamespace;
+import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
 import sun.misc.BASE64Decoder;
 
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
 import java.lang.reflect.Array;
 import java.math.BigDecimal;
 import java.math.BigInteger;
@@ -42,6 +50,7 @@
 import java.util.GregorianCalendar;
 import java.util.List;
 import java.util.TimeZone;
+import java.io.ByteArrayInputStream;
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
  *
@@ -244,8 +253,19 @@
         return Boolean.valueOf(s).booleanValue();
     }
 
-    public static Object convertToanyType(String s) {
-        return s; //todo -> What to do here?
+    public static String convertToanySimpleType(String s) {
+        return s;
+    }
+
+    public static OMElement convertToanyType(String s) {
+        try {
+            XMLStreamReader r = XMLInputFactory.newInstance().createXMLStreamReader(
+                    new ByteArrayInputStream(s.getBytes()));
+            StAXOMBuilder builder = new StAXOMBuilder(OMAbstractFactory.getOMFactory(),r);
+            return builder.getDocumentElement();
+        } catch (XMLStreamException e) {
+            return null;
+        }
     }
 
     public static YearMonth convertTogYearMonth(String s) {

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java?rev=367984&r1=367983&r2=367984&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/BeanWriterMetaInfoHolder.java
Wed Jan 11 01:29:08 2006
@@ -181,7 +181,7 @@
      */
     public boolean getAnyStatusForQName(QName qName) {
         Integer anyState = (Integer) specialTypeFlagMap.get(qName);
-        return anyState != null && anyState.equals(SchemaConstants.ANY_TYPE);
+        return anyState != null && anyState.equals(SchemaConstants.ANY);
     }
 
     /**

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaConstants.java?rev=367984&r1=367983&r2=367984&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaConstants.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/SchemaConstants.java
Wed Jan 11 01:29:08 2006
@@ -79,10 +79,11 @@
     public static final QName XSD_TOKEN = new QName(URI_DEFAULT_SCHEMA_XSD, "token");
 
     public static final Integer ATTRIBUTE_TYPE = new Integer(0);
-    public static final Integer ANY_TYPE = new Integer(1);
+    public static final Integer ANY = new Integer(1);
     public static final Integer ELEMENT_TYPE = new Integer(2);
     public static final Integer ANY_ATTRIBUTE_TYPE = new Integer(3);
     public static final Integer ANY_ARRAY_TYPE = new Integer(4);
+    public static final Integer ANY_TYPE = new Integer(5);
 
 
     public static class SchemaPropertyNames{



Mime
View raw message