<!-- This overrides the default serialization handling for Date objects. It also
  uses a mapping for the flight times information object, and incorporates the
  information from the flight identity object directly into the element that
  matches the parent object. -->
<binding forwards="false">
  <format type="java.util.Date"
    serializer="org.jibx.runtime.Utility.serializeDate"
    deserializer="org.jibx.runtime.Utility.deserializeDate"/>
  <mapping name="timetable" class="multiple.SplitTableBean">
    <collection name="carriers" field="m_carriers"
      item-type="multiple.CarrierBean"/>
    <collection name="airports" field="m_airports"
      item-type="multiple.AirportBean"/>
    <collection field="m_routes" item-type="multiple.SplitRouteBean"/>
  </mapping>
  <mapping name="carrier" class="multiple.CarrierBean">
    <value name="ident" field="m_ident" ident="def"/>
    <value name="rating" field="m_rating"/>
    <value name="URL" field="m_url"/>
    <value name="name" field="m_name"/>
  </mapping>
  <mapping name="airport" class="multiple.AirportBean">
    <value name="ident" field="m_ident" ident="def"/>
    <value name="location" field="m_location"/>
    <value name="name" field="m_name"/>
  </mapping>
  <mapping name="route" class="multiple.SplitRouteBean">
    <value name="from" field="m_from" ident="ref"/>
    <value name="to" field="m_to" ident="ref"/>
    <collection field="m_flights" item-type="multiple.SplitFlightBean"/>
  </mapping>
  <mapping name="flight" class="multiple.SplitFlightBean">
    <structure field="m_identity" pre-set="preset" post-set="postComplete">
      <value name="carrier" field="m_carrier" ident="ref"/>
      <value name="number" field="m_number"/>
      <value name="on-time" field="m_onTime"/>
      <value name="start-date" field="m_startDate" usage="optional"/>
      <value name="end-date" field="m_endDate" usage="optional"/>
    </structure>
    <structure field="m_times"/>
  </mapping>
  <mapping name="times" class="multiple.FlightTimesBean">
    <format type="int"
      serializer="multiple.Utils.minuteToTime"
      deserializer="multiple.Utils.timeToMinute"/>
    <value name="depart" field="m_departure"/>
    <value name="arrive" field="m_arrival"/>
  </mapping>
</binding>
