users@jaxb.java.net

Unmarshalling in a custom way

From: lightbulb432 <veerukrishnan_at_hotmail.com>
Date: Wed, 7 Nov 2007 06:11:50 -0800 (PST)

I have an XML file that I'd like to unmarshall to Java based on
JAXB-annotated classes. I'd like to be able to do this in a custom way,
however - right now every attribute gets unmarshalled as a String. Is there
a way to provide a custom attribute-unmarshaller or something that says to
JAXB if an attribute is of type Class, for example, then use this custom
converter class of mine to convert it from the String value in the XML to a
Class object?

I could of course have a set of data access objects in JAXB with only
Strings then domain objects that do the conversion, but it seems overkill
and a maintenance headache to have two parallel object hierarchies just
because I can't customize the way JAXB unmarshalls.

Is this possible with JAXB, or am I out of luck? Any suggestions?

Thanks.
-- 
View this message in context: http://www.nabble.com/Unmarshalling-in-a-custom-way-tf4764949.html#a13627828
Sent from the java.net - jaxb users mailing list archive at Nabble.com.