Hi fellow castor users and developers,

The long awaited binding file is finally in the CVS: the implementation
has matured a lot during the last year (I started the implementation
back in 2001!!!) and has lead to major clean-up and some re-factoring in
the Source Generator.
The project took so long due to many constraints (finding the proper
binding definition, other tasks with higher priority,...) but I am
finally very pleased to let you play with it.
I promised I will update the Source Generator User documentation as soon
as I get time to do it. For the moment I can just leave you with the
code base and an example of a binding file (attached in that mail) that
you can find under:
./src/examples/SourceGenerator 

Hopefully more bugs were fixed during the partial rewrite of the Source
Generator code than introduced.
If you noticed anything unusual or new bugs in the behavior of the
almost new Source Generator, feel free to yell at me.

Arnaud
<?xml version="1.0"?>
<!-- This file contains the binding information -->
<!-- for the invoice XML Schema -->
<!-- It is meant to be used by the Castor Source Code Generator -->

<cbf:binding xmlns:cbf="http://www.castor.org/SourceGenerator/Binding";
             defaultBindingType='element'>
     
     <!--define the {namespace,package} binding -->
     <cbf:package>
          <cbf:name>test</cbf:name>
          <cbf:namespace>http://castor.exolab.org/Test/Invoice</cbf:namespace>
     </cbf:package>
     
     
     <!-- Binding the Invoice element to a class -->
     <cbf:elementBinding name="invoice">
        <cbf:java-class name="MyInvoice" final="true" equals="true"/>
     </cbf:elementBinding>
    
    <!-- Binding for the Item element -->
    <cbf:elementBinding name="item">
        <cbf:java-class package="test.business" final="true" equals="true">
            <!--<cbf:extends>ItemLogic</cbf:extends>-->
        </cbf:java-class>
        <!-- nested declaration for the price -->
        <cbf:elementBinding name="Price">
            <cbf:member name="specialPrice" java-type="double"/>
         </cbf:elementBinding>
    </cbf:elementBinding>
    
    <!-- avoid name collisions -->
    <cbf:elementBinding name="group:customer/address">
        <cbf:java-class name="AddressElement"/>
    </cbf:elementBinding>
    
    <cbf:complexTypeBinding name="address">
       <cbf:java-class name="MyAddress"/>
       <!--special name for the second street -->
       <cbf:elementBinding name='street2'>
           <cbf:member name="SecondStreet" type="string"/>
       </cbf:elementBinding>
    </cbf:complexTypeBinding>
    
 </cbf:binding>
     

Reply via email to