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/src/configschema/schema binding-config.xsd
Date Tue, 22 Jun 2004 18:18:45 GMT
zieg        2004/06/22 11:18:45

  Modified:    v2/src/binding/org/apache/xmlbeans/impl/binding/bts
                        SoapArrayType.java TypeRegistry.java
               v2/src/binding/org/apache/xmlbeans/impl/binding/compile
                        Schema2Java.java
               v2/src/configschema/schema binding-config.xsd
  Log:
  put back soap array ranks as list of ints
  
  Revision  Changes    Path
  1.5       +3 -3      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/SoapArrayType.java
  
  Index: SoapArrayType.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/SoapArrayType.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SoapArrayType.java	20 Jun 2004 18:19:48 -0000	1.4
  +++ SoapArrayType.java	22 Jun 2004 18:18:45 -0000	1.5
  @@ -32,7 +32,7 @@
     private QName itemName;
     private BindingTypeName itemType;
     private boolean itemNillable;
  -  private int ranks;
  +  private int[] ranks;
   
     private static final long serialVersionUID = 1L;
   
  @@ -89,12 +89,12 @@
       this.itemNillable = nillable;
     }
   
  -  public int getRanks()
  +  public int[] getRanks()
     {
       return ranks;
     }
   
  -  public void setRanks(int ranks)
  +  public void setRanks(int[] ranks)
     {
       this.ranks = ranks;
     }
  
  
  
  1.2       +31 -7     xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/TypeRegistry.java
  
  Index: TypeRegistry.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/bts/TypeRegistry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TypeRegistry.java	20 Jun 2004 18:19:48 -0000	1.1
  +++ TypeRegistry.java	22 Jun 2004 18:18:45 -0000	1.2
  @@ -21,6 +21,8 @@
   import org.apache.xmlbeans.impl.common.XmlWhitespace;
   
   import java.util.Iterator;
  +import java.util.List;
  +import java.util.ArrayList;
   
   final class TypeRegistry
   {
  @@ -281,8 +283,19 @@
   
       wa.setItemNillable(type.isItemNillable());
   
  -    if (type.getRanks() >= 0)
  -      wa.setRanks(type.getRanks());
  +    final int[] ranks = type.getRanks();
  +    if (ranks != null) {
  +      List rl = new ArrayList(ranks.length);
  +      for (int i = 0, alen = ranks.length; i < alen; i++) {
  +        final int rank = ranks[i];
  +        if (rank < 0) {
  +          throw new IllegalStateException("negative rank at index " +
  +                                          i + ": " + rank);
  +        }
  +        rl.add(new Integer(rank));
  +      }
  +      wa.setRanks(rl);
  +    }
     }
   
     private static void writeListArrayType(org.apache.xml.xmlbeans.bindingConfig.BindingType
node,
  @@ -434,11 +447,22 @@
   
       type.setItemNillable(node.getItemNillable());
   
  -
  -    if (node.isSetRanks())
  -      type.setRanks(node.getRanks());
  -    else
  -      type.setRanks(-1);
  +    if (node.isSetRanks()) {
  +      final java.util.List ranks_list = node.getRanks();
  +      if (!ranks_list.isEmpty()) {
  +        final int len = ranks_list.size();
  +        int[] new_ranks = new int[len];
  +        for (int i = 0; i < len; i++) {
  +          final int r = ((Integer)ranks_list.get(i)).intValue();
  +          if (r < 0) {
  +            String msg = "illegal negative array rank: " + ranks_list;
  +            throw new IllegalArgumentException(msg);
  +          }
  +          new_ranks[i] = r;
  +        }
  +        type.setRanks(new_ranks);
  +      }
  +    }
     }
   
     static void fillTypeFromNode(SimpleDocumentBinding simpleDocumentBinding,
  
  
  
  1.28      +2 -1      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Schema2Java.java
  
  Index: Schema2Java.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Schema2Java.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- Schema2Java.java	15 Jun 2004 00:55:58 -0000	1.27
  +++ Schema2Java.java	22 Jun 2004 18:18:45 -0000	1.28
  @@ -799,7 +799,8 @@
         }
         SOAPArrayType aType = getWsdlArrayType(scratch.getSchemaType());
         if (aType != null)
  -        bType.setRanks(aType.getDimensions().length);
  +        //TODO: FIXME -- align with bts
  +        bType.setRanks(new int[]{aType.getDimensions().length});
   
         return;
       }
  
  
  
  1.23      +5 -1      xml-xmlbeans/v2/src/configschema/schema/binding-config.xsd
  
  Index: binding-config.xsd
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/configschema/schema/binding-config.xsd,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- binding-config.xsd	20 Jun 2004 18:19:48 -0000	1.22
  +++ binding-config.xsd	22 Jun 2004 18:18:45 -0000	1.23
  @@ -138,7 +138,11 @@
             <xs:element name="item-name" type="xs:QName" minOccurs="0"/>
             <xs:element name="item-type" type="tns:mapping" minOccurs="0"/>
             <xs:element name="item-nillable" type="xs:boolean" default="false" minOccurs="0"/>
  -          <xs:element name="ranks" type="xs:int" minOccurs="0"/>
  +          <xs:element name="ranks" minOccurs="0">
  +            <xs:simpleType>
  +              <xs:list itemType="xs:int"/>
  +            </xs:simpleType>
  +          </xs:element>
           </xs:sequence>
         </xs:extension>
       </xs:complexContent>
  
  
  

---------------------------------------------------------------------
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