1

I am trying to find a good serialization library in java world. What I need: 1. It can serialize/deserialize object into xml, of course. 2. It has to use xml definition and code can be generated by any clients. I don't want to share code with my clients. I would rather share xml definition and let them generate code from it.

I found JAXB can do No1, but I am not sure if it can adopt No2. Is there anything else I can use.

Thanks a lot.

3 Answers 3

1

You can use JAXB for both the requirement, it can serialize/deserialize ( or we can say Unmarshal and Marshal). The JAXB classes generated from an XML Schema are POJOs with the standard JAXB annotations. As part of Metro there is a project for JAXB providing reference implementation. JSR 222 is developed by JCP for JAXB. You can have a look at these for more details.

Sign up to request clarification or add additional context in comments.

Comments

0

It has to use xml definition and code can be generated by any clients.

You can generate an XML schema from a JAXB model. This XML schema can be considered the XML definition:

And a JAXB model can be generated from an XML schema.

Comments

0

Not sure that I understand your second requirement, but xstream might be the answer

http://x-stream.github.io/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.