Castor - Java-Springs

Castor XML mapping is an open source XML binding framework. It allows you to transform the data contained in a java object model into/from an XML document. By default, it does not require any further configuration, though a mapping file can be used to have more control over the behavior of Castor.

Castor Marshaller

As with JAXB, the Castor Marshaller implements both the Marshaller and Un marshaller interface.It can be wired up as follows:

<beans>
<bean id="castorMarshaller" class="org.springframework.oxm.castor.CastorMarshaller" />
...
</beans>

Mapping

Although it is possible to rely on Castor's default marshalling behavior, it might be necessary to have more control over it. This can be accomplished using a Castor mapping file.

The mapping can be set using the mapping Location resource property, indicated below with a classpath resource.

<beans>
<bean id="castorMarshaller" class="org.spring frame work.oxm.castor.Castor Marshaller" >
<property name="mappingLocation"value="classpath:mapping.xml"/>
</bean>
</beans>

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

Java-Springs Topics