[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jibx-cvs
Subject:    [Jibx-cvs] core/build/test/simple binding5a.xml,NONE,1.1 binding7a.xml,NONE,1.1 binding7b.xml,NONE,1
From:       Dennis Sosnoski <dsosnoski () users ! sourceforge ! net>
Date:       2005-06-24 20:18:07
Message-ID: E1Dlucs-0008PA-EI () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/jibx/core/build/test/simple
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32218/build/test/simple

Modified Files:
	binding3e.xml binding6a.xml binding6b.xml binding7.xml 
	binding8c.xml Customer8a.java Customers7.java Customers8.java 
	simple3b.xml simple6a.xml 
Added Files:
	binding5a.xml binding7a.xml binding7b.xml binding8d.xml 
	Customer8d.java NameMarshaller.java NameUnmarshaller.java 
Log Message:
More test cases.

Index: Customer8a.java
===================================================================
RCS file: /cvsroot/jibx/core/build/test/simple/Customer8a.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Customer8a.java	21 Mar 2005 22:33:35 -0000	1.2
--- Customer8a.java	24 Jun 2005 20:18:05 -0000	1.3
***************
*** 31,40 ****
  public class Customer8a implements ICustomer8
  {
!     public String id;
! 	public Name name;
! 	public String street1;
! 	public String city;
! 	public String state;
!     public int zip;
      
      public void setId(String value) { id = value; }
--- 31,40 ----
  public class Customer8a implements ICustomer8
  {
!     protected String id;
! 	protected Name name;
! 	protected String street1;
! 	protected String city;
! 	protected String state;
!     protected int zip;
      
      public void setId(String value) { id = value; }

Index: binding7.xml
===================================================================
RCS file: /cvsroot/jibx/core/build/test/simple/binding7.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** binding7.xml	3 Jul 2004 19:44:09 -0000	1.1.1.1
--- binding7.xml	24 Jun 2005 20:18:05 -0000	1.2
***************
*** 6,11 ****
      <value name="count" get-method="getCustomerCount"
          set-method="setCustomerCount"/>
!     <collection add-method="addCustomer" iter-method="getCustomerIterator"
!         test-method="hasCustomer" usage="optional">
        <structure name="customer" type="simple.Customers7$CustomerInterface"
            value-style="attribute" factory="simple.Customers7.createCustomer">
--- 6,12 ----
      <value name="count" get-method="getCustomerCount"
          set-method="setCustomerCount"/>
!     <collection add-method="wrappedAddCustomer"
!         iter-method="wrappedGetCustomerIterator"
!         test-method="wrappedHasCustomer" usage="optional">
        <structure name="customer" type="simple.Customers7$CustomerInterface"
            value-style="attribute" factory="simple.Customers7.createCustomer">

Index: simple6a.xml
===================================================================
RCS file: /cvsroot/jibx/core/build/test/simple/simple6a.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** simple6a.xml	3 Jul 2004 19:44:09 -0000	1.1.1.1
--- simple6a.xml	24 Jun 2005 20:18:05 -0000	1.2
***************
*** 6,13 ****
--- 6,15 ----
    <customerB repeat-customer="true" state="WA" zip="98095">
      <customer-id>12346</customer-id>
+     <name first-name="Larry" last-name="Adams"/>
      <order-count>4</order-count>
    </customerB>
    <customerB repeat-customer="true" state="WA" zip="98095" discount="0.9">
      <customer-id>83222</customer-id>
+     <name first-name="Gary" last-name="Adams"/>
      <order-count>2</order-count>
    </customerB>

--- NEW FILE: Customer8d.java ---
/*
Copyright (c) 2003, Dennis M. Sosnoski
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.
 * Neither the name of JiBX nor the names of its contributors may be used
   to endorse or promote products derived from this software without specific
   prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package simple;

public class Customer8d extends Customer8a
{
    private Integer getZip() { return new Integer(zip); }
    private void setZip(Integer value) { zip = value.intValue(); }
}

Index: binding8c.xml
===================================================================
RCS file: /cvsroot/jibx/core/build/test/simple/binding8c.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** binding8c.xml	10 May 2005 08:08:10 -0000	1.1
--- binding8c.xml	24 Jun 2005 20:18:05 -0000	1.2
***************
*** 30,34 ****
        <value name="zip" field="zip"/>
      </mapping>
!     <mapping name="custcoll" class="java.util.ArrayList" abstract="true">
        <collection/>
      </mapping>
--- 30,34 ----
        <value name="zip" field="zip"/>
      </mapping>
!     <mapping name="custcoll" class="java.util.ArrayList">
        <collection/>
      </mapping>

Index: Customers7.java
===================================================================
RCS file: /cvsroot/jibx/core/build/test/simple/Customers7.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Customers7.java	3 Jul 2004 19:44:04 -0000	1.1.1.1
--- Customers7.java	24 Jun 2005 20:18:05 -0000	1.2
***************
*** 33,75 ****
  public class Customers7
  {
! 	private int fillPosition;
! 	private Customer[] customers;
      
      private void setCustomerCount(int count) {
!         customers = new Customer[count];
! 		fillPosition = 0;
      }
  	
  	private int getCustomerCount() {
! 		return fillPosition;
  	}
  	
! 	private void addCustomer(Object obj) {
! 		customers[fillPosition++] = (Customer)obj;
  	}
      
!     private boolean hasCustomer() {
!         return fillPosition > 0;
      }
      
!     private Iterator getCustomerIterator() {
!         return new CustomerIterator();
      }
      
!     private class CustomerIterator implements Iterator {
          
          int nextIndex;
          
!         private CustomerIterator() {
              nextIndex = 0;
          }
  
          public boolean hasNext() {
!             return nextIndex < fillPosition;
          }
  
          public Object next() {
!             if (nextIndex < fillPosition) {
!                 return customers[nextIndex++];
              } else {
                  return null;
--- 33,117 ----
  public class Customers7
  {
!     private DerivedCollection collection = new DerivedCollection();
      
      private void setCustomerCount(int count) {
!         if (count > 0) {
!             collection.setCustomerCount(count);
!         } else {
!             collection = null;
!         }
      }
  	
  	private int getCustomerCount() {
!         if (collection == null) {
!             return 0;
!         } else {
!             return collection.getCustomerCount();
!         }
  	}
  	
! 	private void wrappedAddCustomer(Object obj) {
! 		collection.addCustomer((CustomerInterface)obj);
  	}
      
!     private boolean wrappedHasCustomer() {
!         return collection.hasCustomer();
      }
      
!     private Iterator wrappedGetCustomerIterator() {
!         return new CustomerIterator(collection);
      }
      
!     private static class CustomerCollection {
!         
!         private int fillPosition;
!         private CustomerInterface[] customers;
!         
!         protected void setCustomerCount(int count) {
!             customers = new Customer[count];
!             fillPosition = 0;
!         }
!         
!         protected int getCustomerCount() {
!             return fillPosition;
!         }
          
+         protected void addCustomer(CustomerInterface obj) {
+             customers[fillPosition++] = obj;
+         }
+         
+         protected boolean hasCustomer() {
+             return fillPosition > 0;
+         }
+         
+         protected CustomerInterface getCustomer(int index) {
+             return customers[index];
+         }
+         
+         protected Iterator getCustomerIterator() {
+             return new CustomerIterator(this);
+         }
+     }
+     
+     private static class DerivedCollection extends CustomerCollection {
+     }
+     
+     private static class CustomerIterator implements Iterator {
+         
+         private final CustomerCollection collection;
          int nextIndex;
          
!         private CustomerIterator(CustomerCollection coll) {
!             collection = coll;
              nextIndex = 0;
          }
  
          public boolean hasNext() {
!             return collection != null && nextIndex < collection.fillPosition;
          }
  
          public Object next() {
!             if (nextIndex < collection.fillPosition) {
!                 return collection.getCustomer(nextIndex++);
              } else {
                  return null;

Index: binding3e.xml
===================================================================
RCS file: /cvsroot/jibx/core/build/test/simple/binding3e.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** binding3e.xml	10 May 2005 08:08:10 -0000	1.1
--- binding3e.xml	24 Jun 2005 20:18:05 -0000	1.2
***************
*** 1,4 ****
  <!-- Testing an abstract mapping for a system class.  -->
- 
  <binding>
    <mapping class="java.util.ArrayList" abstract="true">
--- 1,3 ----

--- NEW FILE: binding7b.xml ---
<!-- collection directly from field (without structure wrapper) -->
<binding>
  <mapping name="customers" class="simple.Customers7">
    <value name="count" get-method="getCustomerCount"
        set-method="setCustomerCount"/>
    <collection field="collection" usage="optional" add-method="addCustomer"
        size-method="getCustomerCount" load-method="getCustomer"
        item-type="simple.Customers7$CustomerInterface">
      <structure name="customer" type="simple.Customers7$CustomerInterface"
          value-style="attribute" factory="simple.Customers7.createCustomer">
        <structure name="name" get-method="getName" set-method="setName"
            usage="optional">
          <value name="first-name" field="firstName"/>
          <value name="last-name" field="lastName"/>
        </structure>
        <value name="street1" get-method="getStreet1" set-method="setStreet1"
            style="element"/>
        <value name="city" get-method="getCity" set-method="setCity"
            style="element"/>
        <value name="state" get-method="getState" set-method="setState"/>
        <value name="zip" get-method="getZip" set-method="setZip"/>
      </structure>
    </collection>
  </mapping>
</binding>

Index: simple3b.xml
===================================================================
RCS file: /cvsroot/jibx/core/build/test/simple/simple3b.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** simple3b.xml	3 Jul 2004 19:44:09 -0000	1.1.1.1
--- simple3b.xml	24 Jun 2005 20:18:05 -0000	1.2
***************
*** 17,21 ****
      <city>Plunk</city>
      <state>WA</state>
!     <zip>98059</zip>
      <phone>888.555.4321</phone>
    </customer>
--- 17,21 ----
      <city>Plunk</city>
      <state>WA</state>
!     <zip/>
      <phone>888.555.4321</phone>
    </customer>

Index: binding6b.xml
===================================================================
RCS file: /cvsroot/jibx/core/build/test/simple/binding6b.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** binding6b.xml	3 Jul 2004 19:44:09 -0000	1.1.1.1
--- binding6b.xml	24 Jun 2005 20:18:05 -0000	1.2
***************
*** 1,4 ****
! <!-- alternative binding with implicit "this" references -->
! <binding>
    <mapping name="customers" class="simple.Customers6">
      <value name="count" get-method="getCustomerCount"
--- 1,5 ----
! <!-- alternative binding with implicit "this" references, several added abstract
!  non-base mappings -->
! <binding force-classes="true">
    <mapping name="customers" class="simple.Customers6">
      <value name="count" get-method="getCustomerCount"
***************
*** 19,22 ****
--- 20,26 ----
      <value style="attribute" name="repeat-customer" field="repeat"/>
      <value style="attribute" name="discount" field="discount" default="0.0"/>
+     <structure name="name" type="simple.Customer6bBase">
+       <structure field="name"/>
+     </structure>
      <structure type="simple.Customer6bBase" value-style="attribute">
        <value name="state" field="state"/>
***************
*** 25,27 ****
--- 29,54 ----
      <value name="order-count" field="orderCount" default="0"/>
    </mapping>
+   <mapping abstract="true" class="simple.Name" value-style="attribute">
+     <value name="first-name" field="firstName"/>
+     <value name="last-name" field="lastName"/>
+   </mapping>
+   <mapping abstract="true" class="simple.Customer6aBase">
+     <value name="xstate" field="state"/>
+     <value name="xzip" field="zip"/>
+   </mapping>
+   <mapping abstract="true" class="simple.Customer6bBase"
+       value-style="attribute">
+     <value name="state" field="state"/>
+     <value name="zip" field="zip"/>
+   </mapping>
+   <mapping class="java.util.ArrayList" abstract="true">
+     <collection ordered="false">
+       <value name="order"/>
+     </collection>
+   </mapping>
+   <mapping class="java.util.Vector" abstract="true">
+     <collection ordered="false">
+       <value name="order"/>
+     </collection>
+   </mapping>
  </binding>

--- NEW FILE: NameUnmarshaller.java ---
/*
Copyright (c) 2005, Dennis M. Sosnoski
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.
 * Neither the name of JiBX nor the names of its contributors may be used
   to endorse or promote products derived from this software without specific
   prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package simple;

import org.jibx.runtime.IUnmarshaller;
import org.jibx.runtime.IUnmarshallingContext;
import org.jibx.runtime.JiBXException;
import org.jibx.runtime.impl.UnmarshallingContext;

public class NameUnmarshaller implements IUnmarshaller
{
    /* (non-Javadoc)
     * @see org.jibx.runtime.IUnmarshaller#isPresent(org.jibx.runtime.IUnmarshallingContext)
                
     */
    public boolean isPresent(IUnmarshallingContext ctx) throws JiBXException {
        return ctx.isAt(null, "name");
    }

    /* (non-Javadoc)
     * @see org.jibx.runtime.IUnmarshaller#unmarshal(java.lang.Object, \
                org.jibx.runtime.IUnmarshallingContext)
     */
    public Object unmarshal(Object obj, IUnmarshallingContext ictx) throws \
JiBXException {  UnmarshallingContext ctx = (UnmarshallingContext)ictx;
        Name name = new Name();
        ctx.parsePastStartTag(null, "name");
        name.firstName = ctx.parseElementText(null, "first-name");
        name.lastName = ctx.parseElementText(null, "last-name");
        ctx.parsePastEndTag(null, "name");
        return name;
    }
}
--- NEW FILE: NameMarshaller.java ---
/*
Copyright (c) 2005, Dennis M. Sosnoski
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.
 * Neither the name of JiBX nor the names of its contributors may be used
   to endorse or promote products derived from this software without specific
   prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package simple;

import org.jibx.runtime.IMarshaller;
import org.jibx.runtime.IMarshallingContext;
import org.jibx.runtime.JiBXException;
import org.jibx.runtime.impl.MarshallingContext;

public class NameMarshaller implements IMarshaller
{
    /* (non-Javadoc)
     * @see org.jibx.runtime.IMarshaller#isExtension(int)
     */
    public boolean isExtension(int index) {
        return false;
    }

    /* (non-Javadoc)
     * @see org.jibx.runtime.IMarshaller#marshal(java.lang.Object, \
                org.jibx.runtime.IMarshallingContext)
     */
    public void marshal(Object obj, IMarshallingContext ictx)
        throws JiBXException {
        MarshallingContext ctx = (MarshallingContext)ictx;
        Name name = (Name)obj;
        ctx.startTag(0, "name");
        ctx.element(0, "first-name", name.firstName);
        ctx.element(0, "last-name", name.lastName);
        ctx.endTag(0, "name");
    }
}
Index: binding6a.xml
===================================================================
RCS file: /cvsroot/jibx/core/build/test/simple/binding6a.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** binding6a.xml	3 Jul 2004 19:44:09 -0000	1.1.1.1
--- binding6a.xml	24 Jun 2005 20:18:05 -0000	1.2
***************
*** 1,3 ****
! <!-- variation with only attributes in abstract base mapping -->
  <binding>
    <mapping name="customers" class="simple.Customers6">
--- 1,4 ----
! <!-- variation with only attributes in abstract base mapping, abstract non-base
!   mappings -->
  <binding>
    <mapping name="customers" class="simple.Customers6">
***************
*** 20,23 ****
--- 21,25 ----
    <mapping abstract="true" class="simple.Customer6bBase"
      value-style="attribute">
+     <structure name="name" field="name"/>
      <value name="state" field="state"/>
      <value name="zip" field="zip"/>
***************
*** 31,33 ****
--- 33,44 ----
      <value name="order-count" field="orderCount" default="0"/>
    </mapping>
+   <mapping abstract="true" class="simple.Name" value-style="attribute">
+     <value name="first-name" field="firstName"/>
+     <value name="last-name" field="lastName"/>
+   </mapping>
+   <mapping class="java.util.ArrayList" abstract="true">
+     <collection ordered="false">
+       <value name="order"/>
+     </collection>
+   </mapping>
  </binding>

Index: Customers8.java
===================================================================
RCS file: /cvsroot/jibx/core/build/test/simple/Customers8.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Customers8.java	30 Mar 2005 19:26:22 -0000	1.4
--- Customers8.java	24 Jun 2005 20:18:05 -0000	1.5
***************
*** 33,37 ****
  public class Customers8
  {
! 	private ArrayList customers = new ArrayList();
      
      private int getCount() {
--- 33,37 ----
  public class Customers8
  {
! 	private ArrayList customers = new SubclassedArrayList();
      
      private int getCount() {
***************
*** 54,56 ****
--- 54,63 ----
          customers.add(customer);
      }
+     
+     private static class SubclassedArrayList extends ArrayList {
+         public SubclassedArrayList() { super(); }
+         private void internalAddCustomer(ICustomer8 customer) {
+             super.add(customer);
+         }
+     }
  }

--- NEW FILE: binding8d.xml ---
<!-- Nest abstract mappings inside other mapping, subclassed collection with
  only add-method and item-type overrides, and access to typed methods of base
  class. -->
<binding track-source="true">
  <mapping name="customers" class="simple.Customers8">
    <mapping class="simple.ICustomer8" abstract="true">
      <value name="id" style="attribute" get-method="getId"
          set-method="setId" ident="def"/>
      <structure name="name" get-method="getName" set-method="setName">
        <value name="first-name" field="firstName"/>
        <value name="last-name" field="lastName"/>
      </structure>
      <value name="street1" get-method="getStreet" set-method="setStreet"/>
      <value name="city" get-method="getCity" set-method="setCity"/>
      <value name="state" get-method="getState" set-method="setState"/>
    </mapping>
    <mapping class="simple.ICustomer8c" abstract="true"/>
    <mapping name="customer8a" class="simple.Customer8a"
        extends="simple.ICustomer8">
      <structure map-as="simple.ICustomer8"/>
      <value name="zip" field="zip"/>
    </mapping>
    <mapping name="customer8b" class="simple.Customer8d"
        extends="simple.ICustomer8">
      <value name="id" style="attribute" get-method="getId"
          set-method="setId" ident="def"/>
      <structure name="name" get-method="getName" set-method="setName">
        <value name="first-name" field="firstName"/>
        <value name="last-name" field="lastName"/>
      </structure>
      <value name="street1" get-method="getStreet" set-method="setStreet"/>
      <value name="city" get-method="getCity" set-method="setCity"/>
      <value name="state" get-method="getState" set-method="setState"/>
      <value name="zip" get-method="getZip" set-method="setZip"/>
    </mapping>
    <structure name="custcoll">
      <collection field="customers" type="simple.Customers8$SubclassedArrayList"
          add-method="internalAddCustomer" item-type="simple.ICustomer8"
          usage="optional"/>
    </structure>
  </mapping>
</binding>

--- NEW FILE: binding5a.xml ---
<!-- binding using separate marshaller and unmarshaller classes -->
<binding track-source="true">
  <mapping abstract="true" class="simple.Customer5Base">
    <structure field="name"/>
    <value name="street1" field="street1"/>
    <value name="city" field="city"/>
    <value name="state" field="state"/>
    <value name="zip" field="zip"/>
    <value name="phone" field="phone"/>
  </mapping>
  <mapping name="customer" class="simple.Customer5" value-style="attribute"
      extends="simple.Customer5Base" label="customer5-definition">
    <structure map-as="simple.Customer5Base"/>
    <value name="version" constant="1.0" usage="optional"/>
    <value name="subversion" constant="A" style="element" usage="optional"/>
    <value name="customer-id" field="customerId"/>
    <value name="repeat-customer" field="repeat" default="false"/>
    <value name="order-count" field="orderCount" default="0"/>
    <value name="discount" field="discount" default="1.0"/>
    <collection usage="optional" field="referrals">
      <structure map-as="simple.Customer5a" usage="optional"/>
      <structure map-as="simple.Customer5b" usage="optional"/>
      <structure map-as="simple.Customer5c"/>
    </collection>
  </mapping>
  <mapping name="customer5a" class="simple.Customer5a"
      extends="simple.Customer5Base">
    <value name="source" field="sourceCode"/>
    <structure map-as="simple.Customer5Base"/>
  </mapping>
  <mapping name="customer5b" class="simple.Customer5b"
      extends="simple.Customer5Base">
    <structure field="name" marshaller="simple.NameMarshaller"
        unmarshaller="simple.NameUnmarshaller"/>
    <value name="street1" field="street1"/>
    <value name="city" field="city"/>
    <value name="state" field="state"/>
    <value name="zip" field="zip"/>
    <value name="phone" field="phone"/>
  </mapping>
  <mapping name="customer5c" class="simple.Customer5c"
      extends="simple.Customer5Base">
    <structure using="customer5-definition"/>
    <value name="quality" field="qualityCode"/>
  </mapping>
  <mapping class="simple.Name" marshaller="simple.NameMarshaller"
      unmarshaller="simple.NameUnmarshaller"/>
</binding>

--- NEW FILE: binding7a.xml ---
<!-- using typed collection methods directly -->
<binding>
  <mapping name="customers" class="simple.Customers7">
    <value name="count" get-method="getCustomerCount"
        set-method="setCustomerCount"/>
    <structure field="collection" usage="optional">
      <collection add-method="addCustomer" size-method="getCustomerCount"
          load-method="getCustomer"
          item-type="simple.Customers7$CustomerInterface">
        <structure name="customer" type="simple.Customers7$CustomerInterface"
            value-style="attribute" factory="simple.Customers7.createCustomer">
          <structure name="name" get-method="getName" set-method="setName"
              usage="optional">
            <value name="first-name" field="firstName"/>
            <value name="last-name" field="lastName"/>
          </structure>
          <value name="street1" get-method="getStreet1" set-method="setStreet1"
              style="element"/>
          <value name="city" get-method="getCity" set-method="setCity"
              style="element"/>
          <value name="state" get-method="getState" set-method="setState"/>
          <value name="zip" get-method="getZip" set-method="setZip"/>
        </structure>
      </collection>
    </structure>
  </mapping>
</binding>



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Jibx-cvs mailing list
Jibx-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic