public final class JsonMapConverter extends JsonConverter
Provides a method for parsing a JSON string and converting it to an XQuery item made of nested maps.
The mapping from JSON to XQuery is the following:
()
["foo", true, 123]
)
{1:'foo', 2:true(), 3:123}
)
{"foo": 42, "bar": null}
)
{'foo':42, 'bar':()}
)
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.
|
Item |
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[] name)
Called when a constructor function is opened.
|
void |
stringLit(byte[] value)
Called when a string literal is encountered.
|
convert, convert, get
public Item finish()
JsonConverter
public void openConstr(byte[] name)
JsonConverter
name
- name of the constructorpublic void openArg()
JsonConverter
public void closeArg() throws QueryIOException
JsonConverter
QueryIOException
- query exceptionpublic void closeConstr() throws QueryIOException
JsonConverter
QueryIOException
- query exceptionpublic void numberLit(byte[] value) throws QueryIOException
JsonConverter
value
- string representation of the number literalQueryIOException
- query exceptionpublic void stringLit(byte[] value)
JsonConverter
value
- the stringpublic void nullLit()
JsonConverter
null
literal is encountered.public void booleanLit(byte[] value)
JsonConverter
value
- the booleanCopyright © 2005–2015 BaseX Team. All rights reserved.