TypeMappers of ballerina.lang.typemappers package
typemapper jsonToString(json j) (string )
Converts JSON to a string
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
j | json | JSON value to be converted |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | String representation of the given JSON |
typemapper jsonToxml(json j) (xml )
Converts JSON to XML
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
j | json | JSON value to be converted |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
xml | XML representation of the given JSON |
typemapper stringToJSON(string value) (json )
Converts a string to JSON
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
value | string | String value to be converted |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
json | JSON representation of the given string |
typemapper stringToXML(string value) (xml )
Converts a string to XML
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
value | string | String value to be converted |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
xml | XML representation of the given string |
typemapper xmlToString(xml x) (string )
Converts XML to a string
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
x | xml | value: XML value to be converted |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
string | String representation of the given XML |
typemapper xmlTojson(xml x) (json )
Converts XML to JSON
Parameters:
Parameter Name | Data Type | Description |
---|---|---|
x | xml | XML value to be converted |
Return Parameters:
Return Variable | Data Type | Description |
---|---|---|
json | JSON representation of the given XML |