Henry,

You can implement an org.exolab.castor.xml.XMLClassDescriptor for
java.util.Date and then register this with the ClassDescriptorResolver
before processing:

import org.exolab.castor.xml.ClassDescriptorResolver;
import org.exolab.castor.xml.util.ClassDescriptorResolverImpl;

ClassDescriptorResolverImpl cdr = new ClassDescriptorResolverImpl();
cdr.associate(java.util.Date.class, new MyDateDescriptor());

A perfect example on how to write the MyDateDescriptor class would be:

org/exolab/castor/xml/descriptors/DateClassDescriptor.java

you may also want to look at:

org/exolab/castor/xml/handlers/DateFieldHandler.java


--Keith



> Voyer Henry wrote:
> 
> Hi everyone
> 
> I used to have mappings and handlers for my objects.
> 
> Since I have dozens of classes, I need to stop using mappings and  try
> to use programmed configurations. Since the classes can change.
> 
> Is there a way ,with examples, to specify the handler to use for
> different types. Types like dates, timestamps, etc, objects
> 
> via a java interface or class.
> Etc.
> 
> Thanks
> 
> Regards
> 
> henry

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to