Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0-RC1
    • Component/s: core
    • Labels:
      None
    • Number of attachments :
      0

      Description

      xs:choice support is worth adding, and should be easy to fit into the code generation (since it's already basically there for the collection handling case; the only difference is that for a choice there's no looping to handle multiple elements).

        Activity

        Hide
        Dennis Sosnoski added a comment -

        Implemented this to the extent possible in the 1.0 architecture. The big problem is that there's no real way to support a true choice for marshalling, since the components don't provide any way for the container to check if they're present.

        Show
        Dennis Sosnoski added a comment - Implemented this to the extent possible in the 1.0 architecture. The big problem is that there's no real way to support a true choice for marshalling, since the components don't provide any way for the container to check if they're present.
        Hide
        Maros Ivanco added a comment -

        What about support for marshalling choice, when choice elements are mapped into the same field?:

        class ...

        { private Vehicle vehicle; }

        <mapping ...>
        <structure field="vehicle" type="Vehicle" map-as="Car" usage="optional"/>
        <structure field="vehicle" type="Vehicle" map-as="Truck" usage="optional"/>
        .
        .
        .
        </mapping>

        <...>
        <car id="1"/>
        </...>

        or

        <...>
        <truck weight="1"/>
        </...>

        This case seams to be similar to the heterogenous collections...

        Show
        Maros Ivanco added a comment - What about support for marshalling choice, when choice elements are mapped into the same field?: class ... { private Vehicle vehicle; } <mapping ...> <structure field="vehicle" type="Vehicle" map-as="Car" usage="optional"/> <structure field="vehicle" type="Vehicle" map-as="Truck" usage="optional"/> . . . </mapping> <...> <car id="1"/> </...> or <...> <truck weight="1"/> </...> This case seams to be similar to the heterogenous collections...
        Hide
        Dennis Sosnoski added a comment -

        The above (Maros's comment) can already be done in several ways, such as by defining an abstract mapping for the Vehicle class which is extended by a concrete mapping each Vehicle subclass. There's then no need to list these as explicit alternatives for the "vehicle" field - they'll automatically be handled based on the actual type of vehicle found at runtime (or the actual element name, when unmarshalling).

        Show
        Dennis Sosnoski added a comment - The above (Maros's comment) can already be done in several ways, such as by defining an abstract mapping for the Vehicle class which is extended by a concrete mapping each Vehicle subclass. There's then no need to list these as explicit alternatives for the "vehicle" field - they'll automatically be handled based on the actual type of vehicle found at runtime (or the actual element name, when unmarshalling).

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Dennis Sosnoski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: