17.7.1JibxMarshaller
TheJibxMarshaller
class implements both theMarshaller
andUnmarshaller
interface. To operate, it requires the name of the class to marshal in, which you can set using thetargetClass
property. Optionally, you can set the binding name using thebindingName
property. In the next sample, we bind theFlights
class:
<beans>
<bean id="jibxFlightsMarshaller" class="org.springframework.oxm.jibx.JibxMarshaller">
<property name="targetClass">org.springframework.oxm.jibx.Flights</property>
</bean>
...
</beans>
AJibxMarshaller
is configured for a single class. If you want to marshal multiple classes, you have to configure multipleJibxMarshaller
s with differenttargetClass
property values.
XML Schema-based Configuration
Thejibx-marshaller
tag 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 |