JiBX - Java-Springs

The JiBX frame work 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.

JibxMarshaller

The Jibx Marshaller class implements both the Marshaller and Un marshaller interface.To operate, it requires the name of the class to marshal in, which you can set using the target Class property.

Optionally, you can set the binding name using the binding Name property. In the next sample, we bind the Flights class:

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

A Jibx Marshaller is configured for a single class.If you want to marshal multiple classes, you have to configure multiple Jibx Marshallers with different target Class property values.

XML Schema-based Configuration

The jibx-marshaller tag configures a org. spring frame work. oxm. jibx. Jibx Marshaller. Here is an example:

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

Available attributes are:-

Available attributes


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Java-Springs Topics