17.7.1JibxMarshaller

TheJibxMarshallerclass implements both theMarshallerandUnmarshallerinterface. To operate, it requires the name of the class to marshal in, which you can set using thetargetClassproperty. Optionally, you can set the binding name using thebindingNameproperty. In the next sample, we bind theFlightsclass:

<beans>
    <bean id="jibxFlightsMarshaller" class="org.springframework.oxm.jibx.JibxMarshaller">
        <property name="targetClass">org.springframework.oxm.jibx.Flights</property>
    </bean>
    ...
</beans>

AJibxMarshalleris configured for a single class. If you want to marshal multiple classes, you have to configure multipleJibxMarshallers with differenttargetClassproperty values.

XML Schema-based Configuration

Thejibx-marshallertag configures aorg.springframework.oxm.jibx.JibxMarshaller. Here is an example:

<oxm:jibx-marshaller id="marshaller" target-class="org.springframework.ws.samples.airline.schema.Flight"/>

Available attributes are:

Attribute Description Required
id the id of the marshaller no
target-class the target class for this marshaller yes
bindingName the binding name used by this marshaller no

results matching ""

    No results matching ""