public class Xml2JsonConverter extends Object
Constructor and Description |
---|
Xml2JsonConverter(Xml2JsonOptions... options) |
Modifier and Type | Method and Description |
---|---|
String |
convert(Element elem)
Converts the subtree rooted at
elem to a JSON string. |
StringBuilder |
convert(Element elem,
StringBuilder buf)
Converts the subtree rooted at
elem to a JSON string,
appending to an existing buffer. |
public Xml2JsonConverter(Xml2JsonOptions... options)
public StringBuilder convert(Element elem, StringBuilder buf)
elem
to a JSON string,
appending to an existing buffer. This is useful when building a
JSON assignment statment (eg: "var x = OBJECT").
Returns the buffer as a convenience.