mar

28

Castor

Posted by : admin | On : 28 mars 2010

REFERENCE DOCUMENTATION :

http://www.castor.org/reference/html-single/index.html#d0e18

http://www.castor.org/xml-mapping.html

http://www.castor.org/maven-integration.html

http://onjava.com/pub/a/onjava/2001/10/24/xmldatabind.html?page=2

To (un-)marshal data to and from XML, Castor XML can be used in one of three modes:

  • introspection mode
  • mapping mode
  • descriptor mode (aka generation mode)

Introspection Mode

Basicaly this mode is based on Java reflection to map the field in our Java Pojo classes and the XML .

Java reflection is a very powerful way to map that are located in the Java classes , however in many ways it can be versatile …

don’t forget to get in mind that java reflection is very costful in term of time treatement .

Classes to use :

import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.XMLContext
  • In introspection mode , Castor XML uses Java reflection to establish the binding between the Java classes (and their properties) and the XML, following a set of (default) naming rules. Whilst it is possible to change to a different set of naming rules, there’s no way to override this (default) naming for individual artifacts. In such a case, a mapping file should be used.

Laisser un commentaire

Your email address will not be published. Required fields are marked *