The JiBX framework offers a solution similar to that which JDO provides for ORM: a binding definition defines the rules for how your Java objects are converted to or from XML. After preparing the binding and compiling the classes, a JiBX binding compiler enhances the class files, and adds code to handle converting instances of the classes from or to XML.
For more information on JiBX, refer to the JiBX web site. The Spring integration classes reside in the org.springframework.oxm.jibx package.
JibxMarshaller class implements both the
To operate, it requires the name of the class to marshall in, which you can set using the
targetClass property. Optionally, you can set the binding name using the
bindingName property. In the next sample, we bind the
<beans> <bean id="jibxFlightsMarshaller" class="org.springframework.oxm.jibx.JibxMarshaller"> <property name="targetClass">org.springframework.oxm.jibx.Flights</property> </bean> ...
JibxMarshaller is configured for a single class. If you want to marshal
multiple classes, you have to configure multiple
different targetClass property values.
jibx-marshaller tag configures a
Here is an example:
<oxm:jibx-marshaller id="marshaller" target-class="org.springframework.ws.samples.airline.schema.Flight"/>
Available attributes are:
|the id of the marshaller||no|
|the target class for this marshaller||yes|
|the binding name used by this marshaller||no|