JSONHelper
Path
com.huawei.livedata.lambdaservice.util.JSONHelper
Description
This class is used to perform conversion between JSON and XML and between JSON and Map.
Method List
Returned Type |
Method and Description |
---|---|
static String |
json2Xml(String json) Convert from JSON to XML. |
static String |
xml2Json(String xml) Convert from XML to JSON. |
static String |
json2XmlWithoutType(String json) Convert from JSON to XML. |
static HashMap |
jsonToMap(String json) Convert from JSON to Map. |
Method Details
- public static String json2Xml(String json)
Convert from JSON to XML.
Input Parameter
json indicates a character string in JSON format.
Returns
Character string in the XML format.
- public static String xml2Json(String xml)
Convert from XML to JSON.
Input Parameter
xml indicates a character string in XML format.
Returns
Character string in the JSON format.
- public static String json2XmlWithoutType(String json)
Convert from JSON to XML.
Input Parameter
json indicates a character string in JSON format.
Returns
Character string in the XML format.
- public static HashMap jsonToMap(String json)
Convert from JSON to Map.
Input Parameter
json indicates a character string in JSON format.
Returns
Character string in the Map format.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot