public final class JsonDirectConverter extends JsonConverter
This class converts a JSON document to XML. The converted XML document is both well readable and lossless, i.e., the converted document can be serialized back to the original JSON representation.
The specified JSON input is first transformed into a tree representation and then converted to an XML document, according to the following rules:
<json/>
root node.<_>...</_>
).__
).
<value/>
is used as element name.
type
attribute.type
attribute will be omitted. Instead, the name will be listed in
additional, type-specific attributes in the root node. The attributes
are named by their type in the plural (numbers, booleans,
nulls, objects and arrays), and the attribute
value contains all names with that type, separated by whitespaces.Modifier and Type | Method and Description |
---|---|
void |
booleanLit(byte[] value)
Called when a boolean literal is encountered.
|
void |
closeArg()
Called when an argument of a constructor function is closed.
|
void |
closeConstr()
Called when a constructor function is closed.
|
FDoc |
finish()
Returns the resulting XQuery value.
|
void |
nullLit()
Called when a
null literal is encountered. |
void |
numberLit(byte[] value)
Called when a number literal is encountered.
|
void |
openArg()
Called when an argument of a constructor function is opened.
|
void |
openConstr(byte[] nm)
Called when a constructor function is opened.
|
void |
stringLit(byte[] value)
Called when a string literal is encountered.
|
convert, convert, get
public void openConstr(byte[] nm)
JsonConverter
nm
- name of the constructorpublic void openArg()
JsonConverter
public void closeArg()
JsonConverter
public void closeConstr()
JsonConverter
public void numberLit(byte[] value)
JsonConverter
value
- string representation of the number literalpublic void stringLit(byte[] value)
JsonConverter
value
- the stringpublic void nullLit()
JsonConverter
null
literal is encountered.public void booleanLit(byte[] value)
JsonConverter
value
- the booleanpublic FDoc finish()
JsonConverter
Copyright © 2005–2015 BaseX Team. All rights reserved.