XML to JSON Conversion

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

XML to JSON Conversion

Raja24
Hi,

I'm currently using below code for XML to JSON conversion and XmlJsonDataFormat class is deprecated with newer vestions?
What is the best way to implement this logic?

public static final XmlJsonDataFormat getXMLJSONConvertor() {
                                             final XmlJsonDataFormat xmlJsonDataFormat = new XmlJsonDataFormat();
                                             xmlJsonDataFormat.setEncoding("UTF-8");
                                  xmlJsonDataFormat.setForceTopLevelObject(true);
                                  xmlJsonDataFormat.setTrimSpaces(true);
                                  xmlJsonDataFormat.setRootName("newRoot");
                                  xmlJsonDataFormat.setSkipNamespaces(true);
                                  xmlJsonDataFormat.setRemoveNamespacePrefixes(true);
                                  xmlJsonDataFormat.setExpandableProperties(Arrays.asList("d", "e"));

                                  return xmlJsonDataFormat;

               }


Thanks,
Raja
*************************************************************************
This e-mail may contain confidential or privileged information.
If you are not the intended recipient, please notify the sender immediately and then delete it.

TIAA
*************************************************************************