I need to customize the marshalling of a class, and it sounds like Castor
lets you do that:
"To use "compile-time" class descriptors, one can either implement the
org.exolab.castor.xml.XMLClassDescriptor interface for each class which
needs to be "described", or have the Source Code Generator create the proper
descriptors."
But it's not clear to me how to add a class derived from XMLClassDescriptor
to the mapping...can someone fill in the blanks below (or tell me if it's
possible), so that I can use a mapping that takes most of its marshalling
info from a XML mapping file but also uses a couple custom ClassDescriptors?
Mapping mapping = new Mapping();
mapping.loadMapping(args[0]);
// StreetNameAffixDescriptor implements XMLClassDescriptor
StreetNameAffixDescriptor classDesc = new StreetNameAffixDescriptor();
// now, somehow add classDesc to mapping.
// Is mapping.getRoot() involved? mapping.getResolver()?
FileWriter file = new FileWriter("pointLocProf.xml");
Marshaller mar = new Marshaller(file);
mar.setMapping(mapping);
mar.setSuppressXSIType(true);
mar.marshal(pointLocProf);
file.close();
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev