NewBeee_Java
NewBeee_Java

Reputation:

Deserializing XML to Object

I have a xml file, which is not serialized using XStream.
It may be in any custom but fixed format,
How to use XStream or any efficient api to de serialize it to Object.

Upvotes: 0

Views: 2924

Answers (4)

ng.
ng.

Reputation: 7189

The most performant XML serializer is Simple. Its both faster and more memory efficient than JAXB. Its also much easier to use. Everything can be done via annotations, you do not have to deal with XML directly.

Upvotes: 0

posdef
posdef

Reputation: 6562

I believe you need to implement your own Converter, see this tutorial

Edit: There are surely other ways (read: other packages) to sort this out, but in your question you have mentioned that you wanted to use XStream, hence my reply, and the link to tutorials there.

Upvotes: 0

bdoughan
bdoughan

Reputation: 149047

You could use the @XmlPath extension in MOXy JAXB to map your object model to any XML document without worrying about writing converters. You can also use the externalized metadata format to apply multiple mappings to your object model:

For more information see:

Upvotes: 0

Related Questions