Need a tool to convert POJO to XML and JSON based on XML mapping

I need an open source tool that can convert POJO to XML and JSON strings.

Jersey (and possibly other JAX-RS implementations) would meet these requirements if the mappings could be configured through xml files, but not through annotations.

Is there anything suitable?

+3
source share
4 answers

POJO for XML

JAXB is the Java standard ( JSR-222 ) for converting Java objects to / from XML (I am a member of the JAXB expert group):

POJO for JSON

JAXB Jettison JSON. ( JAX-RS) POJO JSON.

XML

XML, EclipseLink JAXB (MOXy), - MOXy tech :

+2

JSON; GSON, Jackson . ; , , , POJO. , JAXB, (, JAXB XML).

Jackson, jackson-xml-databind, POJO XML, .

+2

GSON Check Out to Convert POJO to JSON:

http://code.google.com/p/google-gson/

We have been using a couple of years. Very nice library.

For POJO for XML, Jersey uses JAXB, or you can use your own serializer.

0
source

Source: https://habr.com/ru/post/1796325/


All Articles