xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z...@apache.org
Subject cvs commit: xml-xmlbeans/v2/test/src/drt/drtcases MarshalTests.java
Date Mon, 10 May 2004 22:55:05 GMT
zieg        2004/05/10 15:55:05

  Modified:    v2/src/binding/org/apache/xmlbeans/impl/binding/bts
                        BuiltinBindingLoader.java
                        DefaultBuiltinBindingLoader.java
                        JaxRpcBuiltinBindingLoader.java
               v2/src/marshal/org/apache/xmlbeans/impl/marshal
                        RuntimeBindingTypeTable.java
               v2/test/src/drt/drtcases MarshalTests.java
  Log:
  add soapenc types
  
  Revision  Changes    Path
  1.16      +97 -57    xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/BuiltinBindingLoader.java
  
  Index: BuiltinBindingLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/BuiltinBindingLoader.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- BuiltinBindingLoader.java	7 Apr 2004 23:30:56 -0000	1.15
  +++ BuiltinBindingLoader.java	10 May 2004 22:55:05 -0000	1.16
  @@ -20,64 +20,104 @@
   /**
    * Represents builtin bindings.
    */
  -public abstract class BuiltinBindingLoader extends BaseBindingLoader {
  +public abstract class BuiltinBindingLoader extends BaseBindingLoader
  +{
   
  -  // ========================================================================
  -  // Constants
  +    // ========================================================================
  +    // Constants
   
  -  private static final String xsns = "http://www.w3.org/2001/XMLSchema";
  +    private static final String XSNS = "http://www.w3.org/2001/XMLSchema";
  +    private static final String SOAPENC = "http://schemas.xmlsoap.org/soap/encoding/";
   
  -  // ========================================================================
  -  // Static methods
  -
  -  public static BindingLoader getInstance() {
  -    return getBuiltinBindingLoader(false);
  -  }
  -
  -  public static BindingLoader getBuiltinBindingLoader(boolean jaxRpc) {
  -    if (jaxRpc)
  -      return JaxRpcBuiltinBindingLoader.getInstance();
  -    else
  -      return DefaultBuiltinBindingLoader.getInstance();
  -  }
  -
  -  // ========================================================================
  -  // Private methods
  -
  -  private void addMapping(String xmlType, String javaName, boolean fromJavaDefault, boolean fromXmlDefault) {
  -    XmlTypeName xn = XmlTypeName.forTypeNamed(new QName(xsns, xmlType));
  -    JavaTypeName jn = JavaTypeName.forString(javaName);
  -    BindingTypeName btName = BindingTypeName.forPair(jn, xn);
  -    BindingType bType = new BuiltinBindingType(btName);
  -
  -    addBindingType(bType);
  -    if (fromJavaDefault) {
  -      if (bType.getName().getXmlName().getComponentType() == XmlTypeName.ELEMENT)
  -        addElementFor(bType.getName().getJavaName(), bType.getName());
  -      else
  -        addTypeFor(bType.getName().getJavaName(), bType.getName());
  -    }
  -    if (fromXmlDefault) {
  -      if (bType.getName().getJavaName().isXmlObject())
  -        addXmlObjectFor(bType.getName().getXmlName(), bType.getName());
  -      else
  -        addPojoFor(bType.getName().getXmlName(), bType.getName());
  -    }
  -  }
  -
  -  protected void addPojoTwoWay(String xmlType, String javaName) {
  -    addMapping(xmlType, javaName, true, true);
  -  }
  -
  -  protected void addPojoXml(String xmlType, String javaName) {
  -    addMapping(xmlType, javaName, false, true);
  -  }
  -
  -  protected void addPojoJava(String xmlType, String javaName) {
  -    addMapping(xmlType, javaName, true, false);
  -  }
  -
  -  protected void addPojo(String xmlType, String javaName) {
  -    addMapping(xmlType, javaName, false, false);
  -  }
  +    // ========================================================================
  +    // Static methods
  +
  +    public static BindingLoader getInstance()
  +    {
  +        return getBuiltinBindingLoader(false);
  +    }
  +
  +    public static BindingLoader getBuiltinBindingLoader(boolean jaxRpc)
  +    {
  +        if (jaxRpc)
  +            return JaxRpcBuiltinBindingLoader.getInstance();
  +        else
  +            return DefaultBuiltinBindingLoader.getInstance();
  +    }
  +
  +    // ========================================================================
  +    // Private methods
  +    private void addMapping(String xmlType,
  +                            String javaName,
  +                            boolean fromJavaDefault,
  +                            boolean fromXmlDefault)
  +    {
  +        final QName xml_name = new QName(XSNS, xmlType);
  +        addMapping(xml_name, javaName, fromJavaDefault, fromXmlDefault);
  +    }
  +
  +    private void addSoapMapping(String xmlType,
  +                                String javaName,
  +                                boolean fromJavaDefault,
  +                                boolean fromXmlDefault)
  +    {
  +        final QName xml_name = new QName(SOAPENC, xmlType);
  +        addMapping(xml_name, javaName, fromJavaDefault, fromXmlDefault);
  +    }
  +
  +    private void addMapping(QName xml_name,
  +                            String javaName,
  +                            boolean fromJavaDefault,
  +                            boolean fromXmlDefault)
  +    {
  +        XmlTypeName xn = XmlTypeName.forTypeNamed(xml_name);
  +        JavaTypeName jn = JavaTypeName.forString(javaName);
  +        BindingTypeName btName = BindingTypeName.forPair(jn, xn);
  +        BindingType bType = new BuiltinBindingType(btName);
  +
  +        addBindingType(bType);
  +        if (fromJavaDefault) {
  +            if (bType.getName().getXmlName().getComponentType() == XmlTypeName.ELEMENT)
  +                addElementFor(bType.getName().getJavaName(), bType.getName());
  +            else
  +                addTypeFor(bType.getName().getJavaName(), bType.getName());
  +        }
  +        if (fromXmlDefault) {
  +            if (bType.getName().getJavaName().isXmlObject())
  +                addXmlObjectFor(bType.getName().getXmlName(), bType.getName());
  +            else
  +                addPojoFor(bType.getName().getXmlName(), bType.getName());
  +        }
  +    }
  +
  +    protected void addPojoTwoWay(String xmlType, String javaName)
  +    {
  +        addMapping(xmlType, javaName, true, true);
  +    }
  +
  +    protected void addPojoXml(String xmlType, String javaName)
  +    {
  +        addMapping(xmlType, javaName, false, true);
  +    }
  +
  +    protected void addPojoJava(String xmlType, String javaName)
  +    {
  +        addMapping(xmlType, javaName, true, false);
  +    }
  +
  +    protected void addPojo(String xmlType, String javaName)
  +    {
  +        addMapping(xmlType, javaName, false, false);
  +    }
  +
  +
  +    protected void addSoapPojoXml(String xmlType, String javaName)
  +    {
  +        addSoapMapping(xmlType, javaName, false, true);
  +    }
  +
  +    protected void addSoapPojo(String xmlType, String javaName)
  +    {
  +        addSoapMapping(xmlType, javaName, false, false);
  +    }
   }
  
  
  
  1.5       +178 -103  xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/DefaultBuiltinBindingLoader.java
  
  Index: DefaultBuiltinBindingLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/DefaultBuiltinBindingLoader.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DefaultBuiltinBindingLoader.java	28 Apr 2004 01:46:56 -0000	1.4
  +++ DefaultBuiltinBindingLoader.java	10 May 2004 22:55:05 -0000	1.5
  @@ -19,113 +19,188 @@
   /**
    * Represents builtin bindings.
    */
  -public class DefaultBuiltinBindingLoader extends BuiltinBindingLoader {
  +public class DefaultBuiltinBindingLoader extends BuiltinBindingLoader
  +{
   
  -  // ========================================================================
  -  // Constants
  +    // ========================================================================
  +    // Constants
       private static final BuiltinBindingLoader INSTANCE = new DefaultBuiltinBindingLoader();
   
  -  // ========================================================================
  -  // Factory
  +    // ========================================================================
  +    // Factory
   
  -  public static BindingLoader getInstance() {
  -    return INSTANCE;
  -  }
  -
  -  // ========================================================================
  -  // Private methods
  -
  -  private DefaultBuiltinBindingLoader() {
  -    // todo: should each builtin binding type know about it's print/parse methods?
  -
  -    addPojoXml("anySimpleType", "java.lang.String");
  -
  -    addPojoTwoWay("anyType", "java.lang.Object");
  -
  -    addPojoTwoWay("string", "java.lang.String");
  -    addPojoXml("normalizedString", "java.lang.String");
  -    addPojoXml("token", "java.lang.String");
  -    addPojoXml("language", "java.lang.String");
  -    addPojoXml("Name", "java.lang.String");
  -    addPojoXml("NCName", "java.lang.String");
  -    addPojoXml("NMTOKEN", "java.lang.String");
  -    addPojoXml("NMTOKENS", "java.lang.String[]");
  -    addPojoXml("ID", "java.lang.String");
  -    addPojoXml("IDREF", "java.lang.String");
  -    addPojoXml("IDREFS", "java.lang.String[]");
  -    addPojoXml("ENTITY", "java.lang.String");
  -    addPojoXml("ENTITIES", "java.lang.String[]");
  -
  -    addPojoTwoWay("duration", "org.apache.xmlbeans.GDuration");
  -    addPojo("duration", "java.lang.String");
  -
  -    addPojoTwoWay("dateTime", "java.util.Calendar");
  -    addPojoJava("dateTime", "java.util.Date");
  -    addPojoXml("time", "java.util.Calendar");
  -    addPojoXml("date", "java.util.Calendar");
  -    addPojo("date", "java.util.Date");
  -    addPojoXml("gYearMonth", "java.util.Calendar");
  -    addPojo("gYearMonth", "java.lang.String");
  -    addPojoXml("gYear", "java.util.Calendar");
  -    addPojo("gYear", "int");
  -    addPojo("gYear", "java.lang.String");
  -    addPojoXml("gMonthDay", "java.util.Calendar");
  -    addPojo("gMonthDay", "java.lang.String");
  -    addPojoXml("gMonth", "java.util.Calendar");
  -    addPojo("gMonth", "int");
  -    addPojo("gMonth", "java.lang.String");
  -    addPojoXml("gDay", "java.util.Calendar");
  -    addPojo("gDay", "int");
  -    addPojo("gDay", "java.lang.String");
  -
  -    addPojoTwoWay("boolean", "boolean");
  -    addPojoTwoWay("base64Binary", "byte[]");
  -    addPojoJava("base64Binary", "java.io.InputStream");
  -    addPojoXml("hexBinary", "byte[]");
  -    addPojo("hexBinary", "java.io.InputStream");
  -    addPojoTwoWay("float", "float");
  -    addPojoTwoWay("double", "double");
  -    addPojoTwoWay("decimal", "java.math.BigDecimal");
  -    addPojoTwoWay("integer", "java.math.BigInteger");
  -    addPojoTwoWay("long", "long");
  -    addPojoTwoWay("int", "int");
  -    addPojoTwoWay("short", "short");
  -    addPojoTwoWay("byte", "byte");
  -    addPojoXml("nonPositiveInteger", "java.math.BigInteger");
  -    addPojoXml("negativeInteger", "java.math.BigInteger");
  -    addPojoXml("nonNegativeInteger", "java.math.BigInteger");
  -    addPojoXml("positiveInteger", "java.math.BigInteger");
  -    addPojoXml("unsignedLong", "java.math.BigInteger");
  -
  -    //some don't like BigInteger...
  -    addPojo("integer", "int");
  -    addPojo("nonPositiveInteger", "int");
  -    addPojo("negativeInteger", "int");
  -    addPojo("nonNegativeInteger", "int");
  -    addPojo("positiveInteger", "int");
  -    addPojo("unsignedLong", "int");
  -
  -    addPojoXml("unsignedInt", "long");
  -    addPojoXml("unsignedShort", "int");
  -    addPojoXml("unsignedByte", "short");
  -    addPojoXml("anyURI", "java.lang.String");
  -    addPojoJava("anyURI", "java.net.URI");
  -    addPojoTwoWay("QName", "javax.xml.namespace.QName");
  -    addPojoXml("NOTATION", "java.lang.String");
  -
  -    addPojoJava("float", Float.class.getName());
  -    addPojoJava("double", Double.class.getName());
  -    addPojoJava("long", Long.class.getName());
  -    addPojoJava("int", Integer.class.getName());
  -    addPojoJava("short", Short.class.getName());
  -    addPojoJava("byte", Byte.class.getName());
  -    addPojoJava("boolean", Boolean.class.getName());
  -    addPojoJava("unsignedInt", Long.class.getName());
  -    addPojoJava("unsignedShort", Integer.class.getName());
  -    addPojoJava("unsignedByte", Short.class.getName());
  +    public static BindingLoader getInstance()
  +    {
  +        return INSTANCE;
  +    }
  +
  +    // ========================================================================
  +    // Private methods
  +
  +    private DefaultBuiltinBindingLoader()
  +    {
  +        // todo: should each builtin binding type know about it's print/parse methods?
  +
  +        addPojoXml("anySimpleType", "java.lang.String");
  +
  +        addPojoTwoWay("anyType", "java.lang.Object");
  +
  +        addPojoTwoWay("string", "java.lang.String");
  +        addPojoXml("normalizedString", "java.lang.String");
  +        addPojoXml("token", "java.lang.String");
  +        addPojoXml("language", "java.lang.String");
  +        addPojoXml("Name", "java.lang.String");
  +        addPojoXml("NCName", "java.lang.String");
  +        addPojoXml("NMTOKEN", "java.lang.String");
  +        addPojoXml("NMTOKENS", "java.lang.String[]");
  +        addPojoXml("ID", "java.lang.String");
  +        addPojoXml("IDREF", "java.lang.String");
  +        addPojoXml("IDREFS", "java.lang.String[]");
  +        addPojoXml("ENTITY", "java.lang.String");
  +        addPojoXml("ENTITIES", "java.lang.String[]");
  +
  +        addPojoTwoWay("duration", "org.apache.xmlbeans.GDuration");
  +        addPojo("duration", "java.lang.String");
  +
  +        addPojoTwoWay("dateTime", "java.util.Calendar");
  +        addPojoJava("dateTime", "java.util.Date");
  +        addPojoXml("time", "java.util.Calendar");
  +        addPojoXml("date", "java.util.Calendar");
  +        addPojo("date", "java.util.Date");
  +        addPojoXml("gYearMonth", "java.util.Calendar");
  +        addPojo("gYearMonth", "java.lang.String");
  +        addPojoXml("gYear", "java.util.Calendar");
  +        addPojo("gYear", "int");
  +        addPojo("gYear", "java.lang.String");
  +        addPojoXml("gMonthDay", "java.util.Calendar");
  +        addPojo("gMonthDay", "java.lang.String");
  +        addPojoXml("gMonth", "java.util.Calendar");
  +        addPojo("gMonth", "int");
  +        addPojo("gMonth", "java.lang.String");
  +        addPojoXml("gDay", "java.util.Calendar");
  +        addPojo("gDay", "int");
  +        addPojo("gDay", "java.lang.String");
  +
  +        addPojoTwoWay("boolean", "boolean");
  +        addPojoTwoWay("base64Binary", "byte[]");
  +        addPojoJava("base64Binary", "java.io.InputStream");
  +        addPojoXml("hexBinary", "byte[]");
  +        addPojo("hexBinary", "java.io.InputStream");
  +        addPojoTwoWay("float", "float");
  +        addPojoTwoWay("double", "double");
  +        addPojoTwoWay("decimal", "java.math.BigDecimal");
  +        addPojoTwoWay("integer", "java.math.BigInteger");
  +        addPojoTwoWay("long", "long");
  +        addPojoTwoWay("int", "int");
  +        addPojoTwoWay("short", "short");
  +        addPojoTwoWay("byte", "byte");
  +        addPojoXml("nonPositiveInteger", "java.math.BigInteger");
  +        addPojoXml("negativeInteger", "java.math.BigInteger");
  +        addPojoXml("nonNegativeInteger", "java.math.BigInteger");
  +        addPojoXml("positiveInteger", "java.math.BigInteger");
  +        addPojoXml("unsignedLong", "java.math.BigInteger");
  +
  +        //some don't like BigInteger...
  +        addPojo("integer", "int");
  +        addPojo("nonPositiveInteger", "int");
  +        addPojo("negativeInteger", "int");
  +        addPojo("nonNegativeInteger", "int");
  +        addPojo("positiveInteger", "int");
  +        addPojo("unsignedLong", "int");
  +
  +        addPojoXml("unsignedInt", "long");
  +        addPojoXml("unsignedShort", "int");
  +        addPojoXml("unsignedByte", "short");
  +        addPojoXml("anyURI", "java.lang.String");
  +        addPojoJava("anyURI", "java.net.URI");
  +        addPojoTwoWay("QName", "javax.xml.namespace.QName");
  +        addPojoXml("NOTATION", "java.lang.String");
  +
  +        addPojoJava("float", Float.class.getName());
  +        addPojoJava("double", Double.class.getName());
  +        addPojoJava("long", Long.class.getName());
  +        addPojoJava("int", Integer.class.getName());
  +        addPojoJava("short", Short.class.getName());
  +        addPojoJava("byte", Byte.class.getName());
  +        addPojoJava("boolean", Boolean.class.getName());
  +        addPojoJava("unsignedInt", Long.class.getName());
  +        addPojoJava("unsignedShort", Integer.class.getName());
  +        addPojoJava("unsignedByte", Short.class.getName());
  +
  +        //TODO: deal with char and java.lang.Character
  +
  +
  +        //=============== SOAPENC types =================
  +        //basically a copy of what is above but soap types are never the default
  +        //for java->schema, and soap types are never mapped to java primitives
  +        //since they are all nillable (per JAX-RPC 1.1), though one could
  +        //imagine using isSet methods to allow mapping to primitives.
  +
  +        addSoapPojoXml("string", "java.lang.String");
  +        addSoapPojoXml("normalizedString", "java.lang.String");
  +        addSoapPojoXml("token", "java.lang.String");
  +        addSoapPojoXml("language", "java.lang.String");
  +        addSoapPojoXml("Name", "java.lang.String");
  +        addSoapPojoXml("NCName", "java.lang.String");
  +        addSoapPojoXml("NMTOKEN", "java.lang.String");
  +        addSoapPojoXml("NMTOKENS", "java.lang.String[]");
  +        addSoapPojoXml("ID", "java.lang.String");
  +        addSoapPojoXml("IDREF", "java.lang.String");
  +        addSoapPojoXml("IDREFS", "java.lang.String[]");
  +        addSoapPojoXml("ENTITY", "java.lang.String");
  +        addSoapPojoXml("ENTITIES", "java.lang.String[]");
  +
  +        addSoapPojoXml("duration", "org.apache.xmlbeans.GDuration");
  +        addSoapPojo("duration", "java.lang.String");
  +
  +        addSoapPojoXml("dateTime", "java.util.Calendar");
  +        addSoapPojo("dateTime", "java.util.Date");
  +        addSoapPojoXml("time", "java.util.Calendar");
  +        addSoapPojoXml("date", "java.util.Calendar");
  +        addSoapPojo("date", "java.util.Date");
  +        addSoapPojoXml("gYearMonth", "java.util.Calendar");
  +        addSoapPojo("gYearMonth", "java.lang.String");
  +        addSoapPojoXml("gYear", "java.util.Calendar");
  +        addSoapPojo("gYear", "java.lang.String");
  +        addSoapPojoXml("gMonthDay", "java.util.Calendar");
  +        addSoapPojo("gMonthDay", "java.lang.String");
  +        addSoapPojoXml("gMonth", "java.util.Calendar");
  +        addSoapPojo("gMonth", "java.lang.String");
  +        addSoapPojoXml("gDay", "java.util.Calendar");
  +        addSoapPojo("gDay", "java.lang.String");
  +
  +        addSoapPojoXml("base64Binary", "byte[]");
  +        addSoapPojo("base64Binary", "java.io.InputStream");
  +        addSoapPojoXml("hexBinary", "byte[]");
  +        addSoapPojo("hexBinary", "java.io.InputStream");
  +        addSoapPojoXml("decimal", "java.math.BigDecimal");
  +        addSoapPojoXml("integer", "java.math.BigInteger");
  +        addSoapPojoXml("nonPositiveInteger", "java.math.BigInteger");
  +        addSoapPojoXml("negativeInteger", "java.math.BigInteger");
  +        addSoapPojoXml("nonNegativeInteger", "java.math.BigInteger");
  +        addSoapPojoXml("positiveInteger", "java.math.BigInteger");
  +        addSoapPojoXml("unsignedLong", "java.math.BigInteger");
  +
  +
  +        addSoapPojoXml("unsignedInt", Long.class.getName());
  +        addSoapPojoXml("unsignedShort", Integer.class.getName());
  +        addSoapPojoXml("unsignedByte", Short.class.getName());
  +        addSoapPojoXml("anyURI", "java.lang.String");
  +        addSoapPojo("anyURI", "java.net.URI");
  +        addSoapPojoXml("QName", "javax.xml.namespace.QName");
  +        addSoapPojoXml("NOTATION", "java.lang.String");
  +
  +        addSoapPojoXml("float", Float.class.getName());
  +        addSoapPojoXml("double", Double.class.getName());
  +        addSoapPojoXml("long", Long.class.getName());
  +        addSoapPojoXml("int", Integer.class.getName());
  +        addSoapPojoXml("short", Short.class.getName());
  +        addSoapPojoXml("byte", Byte.class.getName());
  +        addSoapPojoXml("boolean", Boolean.class.getName());
  +        addSoapPojoXml("unsignedInt", Long.class.getName());
  +        addSoapPojoXml("unsignedShort", Integer.class.getName());
  +        addSoapPojoXml("unsignedByte", Short.class.getName());
   
  -    //TODO: deal with char and java.lang.Character
  -
  -  }
  +    }
   
   }
  
  
  
  1.3       +169 -94   xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/JaxRpcBuiltinBindingLoader.java
  
  Index: JaxRpcBuiltinBindingLoader.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/JaxRpcBuiltinBindingLoader.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JaxRpcBuiltinBindingLoader.java	7 Apr 2004 23:30:56 -0000	1.2
  +++ JaxRpcBuiltinBindingLoader.java	10 May 2004 22:55:05 -0000	1.3
  @@ -16,108 +16,183 @@
   package org.apache.xmlbeans.impl.binding.bts;
   
   
  -
   /**
    * Represents builtin bindings in JAX-RPC style
    */
  -public class JaxRpcBuiltinBindingLoader extends BuiltinBindingLoader {
  +public class JaxRpcBuiltinBindingLoader extends BuiltinBindingLoader
  +{
   
  -  // ========================================================================
  -  // Constants
  +    // ========================================================================
  +    // Constants
       private static final BuiltinBindingLoader INSTANCE = new JaxRpcBuiltinBindingLoader();
   
  -  // ========================================================================
  -  // Factory
  +    // ========================================================================
  +    // Factory
   
  -  public static BindingLoader getInstance() {
  -    return INSTANCE;
  -  }
  -
  -  // ========================================================================
  -  // Private methods
  -
  -  private JaxRpcBuiltinBindingLoader() {
  -    // todo: should each builtin binding type know about it's print/parse methods?
  -
  -    addPojoXml("anySimpleType", "java.lang.String");
  -
  -    addPojoTwoWay("anyType", "java.lang.Object");
  -
  -    addPojoTwoWay("string", "java.lang.String");
  -    addPojoXml("normalizedString", "java.lang.String");
  -    addPojoXml("token", "java.lang.String");
  -    addPojoXml("language", "java.lang.String");
  -    addPojoXml("Name", "java.lang.String");
  -    addPojoXml("NCName", "java.lang.String");
  -    addPojoXml("NMTOKEN", "java.lang.String");
  -    addPojoXml("NMTOKENS", "java.lang.String[]");
  -    addPojoXml("ID", "java.lang.String");
  -    addPojoXml("IDREF", "java.lang.String");
  -    addPojoXml("IDREFS", "java.lang.String[]");
  -    addPojoXml("ENTITY", "java.lang.String");
  -    addPojoXml("ENTITIES", "java.lang.String[]");
  -
  -    addPojoXml("duration", "java.lang.String");
  -    addPojoJava("duration", "org.apache.xmlbeans.GDuration");
  -
  -    addPojoTwoWay("dateTime", "java.util.Calendar");
  -    addPojoJava("dateTime", "java.util.Date");
  -    addPojoXml("time", "java.util.Calendar");
  -    addPojoXml("date", "java.util.Calendar");
  -    addPojo("date", "java.util.Date");
  -    addPojoXml("gYearMonth", "java.lang.String");
  -    addPojo("gYearMonth", "java.util.Calendar");
  -    addPojoXml("gYear", "java.lang.String");
  -    addPojo("gYear", "java.util.Calendar");
  -    addPojo("gYear", "int");
  -    addPojoXml("gMonthDay", "java.lang.String");
  -    addPojo("gMonthDay", "java.util.Calendar");
  -    addPojoXml("gMonth", "java.lang.String");
  -    addPojo("gMonth", "java.util.Calendar");
  -    addPojo("gMonth", "int");
  -    addPojoXml("gDay", "java.lang.String");
  -    addPojo("gDay", "java.util.Calendar");
  -    addPojo("gDay", "int");
  -
  -    addPojoTwoWay("boolean", "boolean");
  -    addPojoTwoWay("base64Binary", "byte[]");
  -    addPojoJava("base64Binary", "java.io.InputStream");
  -    addPojoXml("hexBinary", "byte[]");
  -    addPojo("hexBinary", "java.io.InputStream");
  -    addPojoTwoWay("float", "float");
  -    addPojoTwoWay("double", "double");
  -    addPojoTwoWay("decimal", "java.math.BigDecimal");
  -    addPojoTwoWay("integer", "java.math.BigInteger");
  -    addPojoTwoWay("long", "long");
  -    addPojoTwoWay("int", "int");
  -    addPojoTwoWay("short", "short");
  -    addPojoTwoWay("byte", "byte");
  -    addPojoXml("nonPositiveInteger", "java.math.BigInteger");
  -    addPojoXml("negativeInteger", "java.math.BigInteger");
  -    addPojoXml("nonNegativeInteger", "java.math.BigInteger");
  -    addPojoXml("positiveInteger", "java.math.BigInteger");
  -    addPojoXml("unsignedLong", "java.math.BigInteger");
  -    addPojoXml("unsignedInt", "long");
  -    addPojoXml("unsignedShort", "int");
  -    addPojoXml("unsignedByte", "short");
  -    addPojo("anyURI", "java.lang.String");
  -    addPojoTwoWay("anyURI", "java.net.URI");
  -    addPojoTwoWay("QName", "javax.xml.namespace.QName");
  -    addPojoXml("NOTATION", "java.lang.String");
  -
  -    addPojoJava("float", Float.class.getName());
  -    addPojoJava("double", Double.class.getName());
  -    addPojoJava("long", Long.class.getName());
  -    addPojoJava("int", Integer.class.getName());
  -    addPojoJava("short", Short.class.getName());
  -    addPojoJava("byte", Byte.class.getName());
  -    addPojoJava("boolean", Boolean.class.getName());
  -    addPojoJava("unsignedInt", Long.class.getName());
  -    addPojoJava("unsignedShort", Integer.class.getName());
  -    addPojoJava("unsignedByte", Short.class.getName());
  +    public static BindingLoader getInstance()
  +    {
  +        return INSTANCE;
  +    }
  +
  +    // ========================================================================
  +    // Private methods
  +
  +    private JaxRpcBuiltinBindingLoader()
  +    {
  +        // todo: should each builtin binding type know about it's print/parse methods?
  +
  +        addPojoXml("anySimpleType", "java.lang.String");
  +
  +        addPojoTwoWay("anyType", "java.lang.Object");
  +
  +        addPojoTwoWay("string", "java.lang.String");
  +        addPojoXml("normalizedString", "java.lang.String");
  +        addPojoXml("token", "java.lang.String");
  +        addPojoXml("language", "java.lang.String");
  +        addPojoXml("Name", "java.lang.String");
  +        addPojoXml("NCName", "java.lang.String");
  +        addPojoXml("NMTOKEN", "java.lang.String");
  +        addPojoXml("NMTOKENS", "java.lang.String[]");
  +        addPojoXml("ID", "java.lang.String");
  +        addPojoXml("IDREF", "java.lang.String");
  +        addPojoXml("IDREFS", "java.lang.String[]");
  +        addPojoXml("ENTITY", "java.lang.String");
  +        addPojoXml("ENTITIES", "java.lang.String[]");
  +
  +        addPojoXml("duration", "java.lang.String");
  +        addPojoJava("duration", "org.apache.xmlbeans.GDuration");
  +
  +        addPojoTwoWay("dateTime", "java.util.Calendar");
  +        addPojoJava("dateTime", "java.util.Date");
  +        addPojoXml("time", "java.util.Calendar");
  +        addPojoXml("date", "java.util.Calendar");
  +        addPojo("date", "java.util.Date");
  +        addPojoXml("gYearMonth", "java.lang.String");
  +        addPojo("gYearMonth", "java.util.Calendar");
  +        addPojoXml("gYear", "java.lang.String");
  +        addPojo("gYear", "java.util.Calendar");
  +        addPojo("gYear", "int");
  +        addPojoXml("gMonthDay", "java.lang.String");
  +        addPojo("gMonthDay", "java.util.Calendar");
  +        addPojoXml("gMonth", "java.lang.String");
  +        addPojo("gMonth", "java.util.Calendar");
  +        addPojo("gMonth", "int");
  +        addPojoXml("gDay", "java.lang.String");
  +        addPojo("gDay", "java.util.Calendar");
  +        addPojo("gDay", "int");
  +
  +        addPojoTwoWay("boolean", "boolean");
  +        addPojoTwoWay("base64Binary", "byte[]");
  +        addPojoJava("base64Binary", "java.io.InputStream");
  +        addPojoXml("hexBinary", "byte[]");
  +        addPojo("hexBinary", "java.io.InputStream");
  +        addPojoTwoWay("float", "float");
  +        addPojoTwoWay("double", "double");
  +        addPojoTwoWay("decimal", "java.math.BigDecimal");
  +        addPojoTwoWay("integer", "java.math.BigInteger");
  +        addPojoTwoWay("long", "long");
  +        addPojoTwoWay("int", "int");
  +        addPojoTwoWay("short", "short");
  +        addPojoTwoWay("byte", "byte");
  +        addPojoXml("nonPositiveInteger", "java.math.BigInteger");
  +        addPojoXml("negativeInteger", "java.math.BigInteger");
  +        addPojoXml("nonNegativeInteger", "java.math.BigInteger");
  +        addPojoXml("positiveInteger", "java.math.BigInteger");
  +        addPojoXml("unsignedLong", "java.math.BigInteger");
  +        addPojoXml("unsignedInt", "long");
  +        addPojoXml("unsignedShort", "int");
  +        addPojoXml("unsignedByte", "short");
  +        addPojo("anyURI", "java.lang.String");
  +        addPojoTwoWay("anyURI", "java.net.URI");
  +        addPojoTwoWay("QName", "javax.xml.namespace.QName");
  +        addPojoXml("NOTATION", "java.lang.String");
  +
  +        addPojoJava("float", Float.class.getName());
  +        addPojoJava("double", Double.class.getName());
  +        addPojoJava("long", Long.class.getName());
  +        addPojoJava("int", Integer.class.getName());
  +        addPojoJava("short", Short.class.getName());
  +        addPojoJava("byte", Byte.class.getName());
  +        addPojoJava("boolean", Boolean.class.getName());
  +        addPojoJava("unsignedInt", Long.class.getName());
  +        addPojoJava("unsignedShort", Integer.class.getName());
  +        addPojoJava("unsignedByte", Short.class.getName());
  +
  +        //TODO: deal with char and java.lang.Character
  +
  +        //=============== SOAPENC types =================
  +        //basically a copy of what is above but soap types are never the default
  +        //for java->schema, and soap types are never mapped to java primitives
  +        //since they are all nillable (per JAX-RPC 1.1), though one could
  +        //imagine using isSet methods to allow mapping to primitives.
  +
  +        addSoapPojoXml("string", "java.lang.String");
  +        addSoapPojoXml("normalizedString", "java.lang.String");
  +        addSoapPojoXml("token", "java.lang.String");
  +        addSoapPojoXml("language", "java.lang.String");
  +        addSoapPojoXml("Name", "java.lang.String");
  +        addSoapPojoXml("NCName", "java.lang.String");
  +        addSoapPojoXml("NMTOKEN", "java.lang.String");
  +        addSoapPojoXml("NMTOKENS", "java.lang.String[]");
  +        addSoapPojoXml("ID", "java.lang.String");
  +        addSoapPojoXml("IDREF", "java.lang.String");
  +        addSoapPojoXml("IDREFS", "java.lang.String[]");
  +        addSoapPojoXml("ENTITY", "java.lang.String");
  +        addSoapPojoXml("ENTITIES", "java.lang.String[]");
  +
  +        addSoapPojo("anyURI", "java.lang.String");
  +        addSoapPojoXml("anyURI", "java.net.URI");
  +        addSoapPojoXml("QName", "javax.xml.namespace.QName");
  +        addSoapPojoXml("NOTATION", "java.lang.String");
  +
  +        addSoapPojoXml("duration", "java.lang.String");
  +        addSoapPojo("duration", "org.apache.xmlbeans.GDuration");
  +
  +        addSoapPojoXml("dateTime", "java.util.Calendar");
  +        addSoapPojo("dateTime", "java.util.Date");
  +        addSoapPojoXml("time", "java.util.Calendar");
  +        addSoapPojoXml("date", "java.util.Calendar");
  +        addSoapPojo("date", "java.util.Date");
  +        addSoapPojoXml("gYearMonth", "java.lang.String");
  +        addSoapPojo("gYearMonth", "java.util.Calendar");
  +        addSoapPojoXml("gYear", "java.lang.String");
  +        addSoapPojo("gYear", "java.util.Calendar");
  +        addSoapPojoXml("gMonthDay", "java.lang.String");
  +        addSoapPojo("gMonthDay", "java.util.Calendar");
  +        addSoapPojoXml("gMonth", "java.lang.String");
  +        addSoapPojo("gMonth", "java.util.Calendar");
  +        addSoapPojoXml("gDay", "java.lang.String");
  +        addSoapPojo("gDay", "java.util.Calendar");
  +
  +        addSoapPojoXml("base64Binary", "byte[]");
  +        addSoapPojo("base64Binary", "java.io.InputStream");
  +        addSoapPojoXml("hexBinary", "byte[]");
  +        addSoapPojo("hexBinary", "java.io.InputStream");
  +
  +        addSoapPojoXml("decimal", "java.math.BigDecimal");
  +        addSoapPojoXml("integer", "java.math.BigInteger");
  +
  +        addSoapPojoXml("nonPositiveInteger", "java.math.BigInteger");
  +        addSoapPojoXml("negativeInteger", "java.math.BigInteger");
  +        addSoapPojoXml("nonNegativeInteger", "java.math.BigInteger");
  +        addSoapPojoXml("positiveInteger", "java.math.BigInteger");
  +        addSoapPojoXml("unsignedLong", "java.math.BigInteger");
  +        addSoapPojoXml("unsignedInt", Long.class.getName());
  +        addSoapPojoXml("unsignedShort", Integer.class.getName());
  +        addSoapPojoXml("unsignedByte", Short.class.getName());
  +
  +        addSoapPojoXml("float", Float.class.getName());
  +        addSoapPojoXml("double", Double.class.getName());
  +        addSoapPojoXml("long", Long.class.getName());
  +        addSoapPojoXml("int", Integer.class.getName());
  +        addSoapPojoXml("short", Short.class.getName());
  +        addSoapPojoXml("byte", Byte.class.getName());
  +        addSoapPojoXml("boolean", Boolean.class.getName());
  +        addSoapPojoXml("unsignedInt", Long.class.getName());
  +        addSoapPojoXml("unsignedShort", Integer.class.getName());
  +        addSoapPojoXml("unsignedByte", Short.class.getName());
   
  -    //TODO: deal with char and java.lang.Character
   
  -  }
  +    }
   
   }
  
  
  
  1.33      +150 -62   xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/RuntimeBindingTypeTable.java
  
  Index: RuntimeBindingTypeTable.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/RuntimeBindingTypeTable.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- RuntimeBindingTypeTable.java	10 May 2004 00:15:03 -0000	1.32
  +++ RuntimeBindingTypeTable.java	10 May 2004 22:55:05 -0000	1.33
  @@ -59,6 +59,8 @@
   
   
       private static final String XSD_NS = "http://www.w3.org/2001/XMLSchema";
  +    private static final String SOAPENC_NS = "http://schemas.xmlsoap.org/soap/encoding/";
  +
   
       private static final ConcurrentReaderHashMap BUILTIN_TYPE_MAP;
   
  @@ -187,10 +189,25 @@
                                   JavaTypeName jName,
                                   TypeConverter converter)
       {
  +        QName xml_type = new QName(XSD_NS, xsdType);
  +        addBuiltinType(xml_type, jName, converter);
  +    }
  +
  +    private void addBuiltinSoapType(String xsdType,
  +                                    JavaTypeName jName,
  +                                    TypeConverter converter)
  +    {
  +        QName xml_type = new QName(SOAPENC_NS, xsdType);
  +        addBuiltinType(xml_type, jName, converter);
  +    }
  +
  +    private void addBuiltinType(QName xml_type,
  +                                JavaTypeName jName,
  +                                TypeConverter converter)
  +    {
           final BindingLoader default_builtin_loader =
               BuiltinBindingLoader.getBuiltinBindingLoader(false);
   
  -        QName xml_type = new QName(XSD_NS, xsdType);
           XmlTypeName xName = XmlTypeName.forTypeNamed(xml_type);
           final BindingTypeName btname = BindingTypeName.forPair(jName, xName);
           BindingType btype = default_builtin_loader.getBindingType(btname);
  @@ -218,6 +235,14 @@
       }
   
   
  +    private void addBuiltinSoapType(String xsdType,
  +                                    Class javaClass,
  +                                    TypeConverter converter)
  +    {
  +        final JavaTypeName jName = JavaTypeName.forClassName(javaClass.getName());
  +        addBuiltinSoapType(xsdType, jName, converter);
  +    }
  +
       private void addBuiltinType(String xsdType,
                                   Class javaClass,
                                   TypeConverter converter)
  @@ -255,8 +280,8 @@
           addBuiltinType("positiveInteger", int.class, i2iconv);
           addBuiltinType("unsignedLong", int.class, i2iconv);
   
  -        addBuiltinType("decimal", BigDecimal.class,
  -                       new DecimalTypeConverter());
  +        final DecimalTypeConverter decimal_conv = new DecimalTypeConverter();
  +        addBuiltinType("decimal", BigDecimal.class, decimal_conv);
   
           final LongTypeConverter long_conv = new LongTypeConverter();
           addBuiltinType("long", long.class, long_conv);
  @@ -284,9 +309,9 @@
           addBuiltinType("boolean", boolean.class, boolean_conv);
           addBuiltinType("boolean", Boolean.class, boolean_conv);
   
  -        addBuiltinType("anyURI",
  -                       java.net.URI.class,
  -                       new AnyUriToUriTypeConverter());
  +        final AnyUriToUriTypeConverter uri_uri_conv =
  +            new AnyUriToUriTypeConverter();
  +        addBuiltinType("anyURI", java.net.URI.class, uri_uri_conv);
   
           final Class str = String.class;
           addBuiltinType("anySimpleType", str, new AnySimpleTypeConverter());
  @@ -313,9 +338,9 @@
           addBuiltinType("gYear", str, collapsing_string_conv);
           addBuiltinType("gYearMonth", str, collapsing_string_conv);
   
  -        addBuiltinType("anyURI",
  -                       str,
  -                       new AnyUriToStringTypeConverter());
  +        final AnyUriToStringTypeConverter uri_conv =
  +            new AnyUriToStringTypeConverter();
  +        addBuiltinType("anyURI", str, uri_conv);
   
           final Class str_array = (new String[0]).getClass();
           final StringListArrayConverter string_list_array_conv =
  @@ -327,50 +352,50 @@
           addBuiltinType("NMTOKENS", str_array,
                          string_list_array_conv);
   
  -        addBuiltinType("duration",
  -                       GDuration.class,
  -                       new DurationTypeConverter());
  +        final DurationTypeConverter gduration_conv =
  +            new DurationTypeConverter();
  +        addBuiltinType("duration", GDuration.class, gduration_conv);
   
           final Class calendar_class = java.util.Calendar.class;
  -        addBuiltinType("dateTime",
  -                       calendar_class,
  -                       new JavaCalendarTypeConverter(SchemaType.BTC_DATE_TIME));
  -
  -        addBuiltinType("dateTime",
  -                       java.util.Date.class,
  -                       new JavaDateTypeConverter(SchemaType.BTC_DATE_TIME));
  -
  -        addBuiltinType("time",
  -                       calendar_class,
  -                       new JavaCalendarTypeConverter(SchemaType.BTC_TIME));
  -
  -        addBuiltinType("date",
  -                       calendar_class,
  -                       new JavaCalendarTypeConverter(SchemaType.BTC_DATE));
  -
  -        addBuiltinType("date",
  -                       java.util.Date.class,
  -                       new JavaDateTypeConverter(SchemaType.BTC_DATE));
  -
  -        addBuiltinType("gDay",
  -                       calendar_class,
  -                       new JavaCalendarTypeConverter(SchemaType.BTC_G_DAY));
  -
  -        addBuiltinType("gMonth",
  -                       calendar_class,
  -                       new JavaCalendarTypeConverter(SchemaType.BTC_G_MONTH));
  -
  -        addBuiltinType("gMonthDay",
  -                       calendar_class,
  -                       new JavaCalendarTypeConverter(SchemaType.BTC_G_MONTH_DAY));
  -
  -        addBuiltinType("gYear",
  -                       calendar_class,
  -                       new JavaCalendarTypeConverter(SchemaType.BTC_G_YEAR));
  -
  -        addBuiltinType("gYearMonth",
  -                       calendar_class,
  -                       new JavaCalendarTypeConverter(SchemaType.BTC_G_YEAR_MONTH));
  +        final JavaCalendarTypeConverter date_time_conv =
  +            new JavaCalendarTypeConverter(SchemaType.BTC_DATE_TIME);
  +        addBuiltinType("dateTime", calendar_class, date_time_conv);
  +
  +        final JavaDateTypeConverter date_datetime_conv =
  +            new JavaDateTypeConverter(SchemaType.BTC_DATE_TIME);
  +        addBuiltinType("dateTime", java.util.Date.class, date_datetime_conv);
  +
  +        final JavaCalendarTypeConverter time_conv =
  +            new JavaCalendarTypeConverter(SchemaType.BTC_TIME);
  +        addBuiltinType("time", calendar_class, time_conv);
  +
  +        final JavaCalendarTypeConverter date_conv =
  +            new JavaCalendarTypeConverter(SchemaType.BTC_DATE);
  +        addBuiltinType("date", calendar_class, date_conv);
  +
  +        final JavaDateTypeConverter date_date_conv =
  +            new JavaDateTypeConverter(SchemaType.BTC_DATE);
  +        addBuiltinType("date", java.util.Date.class, date_date_conv);
  +
  +        final JavaCalendarTypeConverter gday_conv =
  +            new JavaCalendarTypeConverter(SchemaType.BTC_G_DAY);
  +        addBuiltinType("gDay", calendar_class, gday_conv);
  +
  +        final JavaCalendarTypeConverter gmonth_conv =
  +            new JavaCalendarTypeConverter(SchemaType.BTC_G_MONTH);
  +        addBuiltinType("gMonth", calendar_class, gmonth_conv);
  +
  +        final JavaCalendarTypeConverter gmonth_day_conv =
  +            new JavaCalendarTypeConverter(SchemaType.BTC_G_MONTH_DAY);
  +        addBuiltinType("gMonthDay", calendar_class, gmonth_day_conv);
  +
  +        final JavaCalendarTypeConverter gyear_conv =
  +            new JavaCalendarTypeConverter(SchemaType.BTC_G_YEAR);
  +        addBuiltinType("gYear", calendar_class, gyear_conv);
  +
  +        final JavaCalendarTypeConverter gyearmonth_conv =
  +            new JavaCalendarTypeConverter(SchemaType.BTC_G_YEAR_MONTH);
  +        addBuiltinType("gYearMonth", calendar_class, gyearmonth_conv);
   
   
           addBuiltinType("gDay",
  @@ -384,22 +409,85 @@
                          new IntDateTypeConverter(SchemaType.BTC_G_YEAR));
   
   
  -        addBuiltinType("QName",
  -                       QName.class,
  -                       new QNameTypeConverter());
  +        final QNameTypeConverter qname_conv = new QNameTypeConverter();
  +        addBuiltinType("QName", QName.class, qname_conv);
   
           final JavaTypeName byte_array_jname =
               JavaTypeName.forArray(JavaTypeName.forString("byte"), 1);
   
  -        addBuiltinType("base64Binary",
  -                       byte_array_jname,
  -                       new Base64BinaryTypeConverter());
  -
  -        addBuiltinType("hexBinary",
  -                       byte_array_jname,
  -                       new HexBinaryTypeConverter());
  +        final Base64BinaryTypeConverter base64_conv =
  +            new Base64BinaryTypeConverter();
  +        addBuiltinType("base64Binary", byte_array_jname, base64_conv);
  +
  +        final HexBinaryTypeConverter hexbin_conv = new HexBinaryTypeConverter();
  +        addBuiltinType("hexBinary", byte_array_jname, hexbin_conv);
   
           //TODO: InputStream based hexBinary and base64Binary converters
  +
  +        //SOAPENC additions...
  +        addBuiltinSoapType("float", Float.class, float_conv);
  +        addBuiltinSoapType("double", Double.class, double_conv);
  +        addBuiltinSoapType("integer", bigint, integer_conv);
  +        addBuiltinSoapType("nonPositiveInteger", bigint, integer_conv);
  +        addBuiltinSoapType("negativeInteger", bigint, integer_conv);
  +        addBuiltinSoapType("nonNegativeInteger", bigint, integer_conv);
  +        addBuiltinSoapType("positiveInteger", bigint, integer_conv);
  +        addBuiltinSoapType("unsignedLong", bigint, integer_conv);
  +        addBuiltinSoapType("decimal", BigDecimal.class,
  +                           decimal_conv);
  +        addBuiltinSoapType("long", Long.class, long_conv);
  +        addBuiltinSoapType("unsignedInt", Long.class, long_conv);
  +        addBuiltinSoapType("int", Integer.class, int_conv);
  +        addBuiltinSoapType("unsignedShort", Integer.class, int_conv);
  +        addBuiltinSoapType("short", Short.class, short_conv);
  +        addBuiltinSoapType("unsignedByte", Short.class, short_conv);
  +        addBuiltinSoapType("byte", Byte.class, byte_conv);
  +        addBuiltinSoapType("boolean", Boolean.class, boolean_conv);
  +
  +        addBuiltinSoapType("anyURI", java.net.URI.class, uri_uri_conv);
  +
  +        addBuiltinSoapType("string", str, string_conv);
  +        addBuiltinSoapType("normalizedString", str, string_conv);
  +        addBuiltinSoapType("token", str, string_conv);
  +        addBuiltinSoapType("language", str, string_conv);
  +        addBuiltinSoapType("Name", str, string_conv);
  +        addBuiltinSoapType("NCName", str, string_conv);
  +        addBuiltinSoapType("NMTOKEN", str, string_conv);
  +        addBuiltinSoapType("ID", str, string_conv);
  +        addBuiltinSoapType("IDREF", str, string_conv);
  +        addBuiltinSoapType("ENTITY", str, string_conv);
  +
  +        addBuiltinSoapType("NOTATION", str, collapsing_string_conv);
  +        addBuiltinSoapType("duration", str, collapsing_string_conv);
  +        addBuiltinSoapType("gDay", str, collapsing_string_conv);
  +        addBuiltinSoapType("gMonth", str, collapsing_string_conv);
  +        addBuiltinSoapType("gMonthDay", str, collapsing_string_conv);
  +        addBuiltinSoapType("gYear", str, collapsing_string_conv);
  +        addBuiltinSoapType("gYearMonth", str, collapsing_string_conv);
  +
  +        addBuiltinSoapType("anyURI", str, uri_conv);
  +
  +        addBuiltinSoapType("ENTITIES", str_array, string_list_array_conv);
  +        addBuiltinSoapType("IDREFS", str_array, string_list_array_conv);
  +        addBuiltinSoapType("NMTOKENS", str_array, string_list_array_conv);
  +
  +        addBuiltinSoapType("duration", GDuration.class, gduration_conv);
  +        addBuiltinSoapType("dateTime", calendar_class, date_time_conv);
  +        addBuiltinSoapType("dateTime", java.util.Date.class, date_datetime_conv);
  +        addBuiltinSoapType("time", calendar_class, time_conv);
  +        addBuiltinSoapType("date", calendar_class, date_conv);
  +        addBuiltinSoapType("date", java.util.Date.class, date_date_conv);
  +        addBuiltinSoapType("gDay", calendar_class, gday_conv);
  +        addBuiltinSoapType("gMonth", calendar_class, gmonth_conv);
  +        addBuiltinSoapType("gMonthDay", calendar_class, gmonth_day_conv);
  +        addBuiltinSoapType("gYear", calendar_class, gyear_conv);
  +        addBuiltinSoapType("gYearMonth", calendar_class, gyearmonth_conv);
  +
  +        addBuiltinSoapType("QName", QName.class, qname_conv);
  +
  +        addBuiltinSoapType("base64Binary", byte_array_jname, base64_conv);
  +        addBuiltinSoapType("hexBinary", byte_array_jname, hexbin_conv);
  +
       }
   
       private static TypeUnmarshaller createSimpleTypeUnmarshaller(SimpleBindingType stype,
  @@ -511,7 +599,7 @@
       {
           final TypeMarshaller m;
   
  -        //REVIEW: consider using vistor
  +        //REVIEW: consider using visitor
   
           if (binding_type instanceof SimpleContentBean) {
               SimpleContentBean scb = (SimpleContentBean)binding_type;
  
  
  
  1.63      +16 -1     xml-xmlbeans/v2/test/src/drt/drtcases/MarshalTests.java
  
  Index: MarshalTests.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/test/src/drt/drtcases/MarshalTests.java,v
  retrieving revision 1.62
  retrieving revision 1.63
  diff -u -r1.62 -r1.63
  --- MarshalTests.java	10 May 2004 00:15:03 -0000	1.62
  +++ MarshalTests.java	10 May 2004 22:55:05 -0000	1.63
  @@ -92,6 +92,8 @@
       private static final BigInteger DEFAULT_BIG_INT =
           new BigInteger("876587658765876587658765876587658765");
       private static final String XSD_URI = "http://www.w3.org/2001/XMLSchema";
  +    private static final String SOAPENC_URI = "http://schemas.xmlsoap.org/soap/encoding/";
  +
   
       public MarshalTests(String name)
       {
  @@ -213,6 +215,8 @@
           testSimpleTypeUnmarshal(strs, "foo bar", "IDREFS");
           testSimpleTypeUnmarshal(strs, "foo bar", "NMTOKENS");
   
  +        testSimpleTypeUnmarshal("basic", "basic", SOAPENC_URI, "string");
  +        testSimpleTypeUnmarshal(new Integer("123"), "123", SOAPENC_URI, "int");
       }
   
       private void testStringTypeUnmarshal(String xsd_type)
  @@ -268,11 +272,22 @@
                                           String xsd_type)
           throws Exception
       {
  +        testSimpleTypeUnmarshal(expected, lexval, XSD_URI, xsd_type);
  +    }
  +
  +    public void testSimpleTypeUnmarshal(Object expected,
  +                                        String lexval,
  +                                        String type_uri,
  +                                        String xsd_type)
  +        throws Exception
  +    {
           BindingContext bindingContext = getBuiltinBindingContext();
   
           String xmldoc = "<a" +
               " xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" +
  -            " xmlns:xs='http://www.w3.org/2001/XMLSchema' xsi:type='xs:" +
  +            " xmlns:xs='" +
  +            type_uri +
  +            "' xsi:type='xs:" +
               xsd_type + "' >" + lexval + "</a>";
   
           StringReader stringReader = new StringReader(xmldoc);
  
  
  

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


Mime
View raw message