aspose file tools*
The moose likes XML and Related Technologies and the fly likes jaxb - xmladapter for rootElement? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "jaxb - xmladapter for rootElement?" Watch "jaxb - xmladapter for rootElement?" New topic
Author

jaxb - xmladapter for rootElement?

dan volfman
Greenhorn

Joined: Jan 15, 2010
Posts: 6
hi,
i need something that will act like an xmlAdapter, but will be defined on a xmlRootElement (rather than on a field).

the purpose is custom marshalling and unmarshalling of fields which will be determined by the fields values.
for example, if a field value is of a particular syntax, then the field will be changed while unmarshalling .

i have a lot of objects that are serialized to xml files, and a lot of fields that potentially could be changed, and thats why i'm looking for a solution at the rootElement level and not at the field level.

any suggestions?

thanks.
Blaise Doughan
Greenhorn

Joined: Aug 25, 2010
Posts: 8
You can specify the @XmlJavaTypeAdapter annotation at the class level. This means that that any property of this particular class will automatically use the adapter. Unfortumately the adapter does not get activated when this object is the root object of the tree. In this case you need to call the adapter yourself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jaxb - xmladapter for rootElement?
 
Similar Threads
Hibernate 2: hsess.refresh(book); (or "is anything changed in the db")
sending back XML from the service provider
Tracking field level changes
Syntax error in INSERT statement
Star Trek question