public class JsonHandlerMap extends Object implements JsonHandler
Constructor and Description |
---|
JsonHandlerMap(XPathContext context) |
Modifier and Type | Method and Description |
---|---|
void |
endArray()
Close the current array
|
void |
endMap()
Close the current object/map
|
Item |
getResult() |
void |
setKey(String key)
Set the key to be written for the next entry in an object/map
|
void |
startArray()
Open a new array
|
void |
startMap()
Start a new object/map
|
void |
writeBoolean(boolean value)
Write a boolean value
|
void |
writeNull()
Write a null value
|
void |
writeNumeric(String asString,
double asDouble)
Write a numeric value
|
void |
writeString(String val)
Write a string value
|
public JsonHandlerMap(XPathContext context)
public Item getResult() throws XPathException
getResult
in interface JsonHandler
XPathException
public void setKey(String key)
setKey
in interface JsonHandler
key
- the key for the entry - null implies no keypublic void startArray() throws XPathException
startArray
in interface JsonHandler
XPathException
public void endArray() throws XPathException
endArray
in interface JsonHandler
XPathException
public void startMap() throws XPathException
startMap
in interface JsonHandler
XPathException
public void endMap() throws XPathException
endMap
in interface JsonHandler
XPathException
public void writeNumeric(String asString, double asDouble) throws XPathException
writeNumeric
in interface JsonHandler
asString
- the string representation of the valueasDouble
- the double representation of the valueXPathException
- if a dynamic error occurspublic void writeString(String val) throws XPathException
writeString
in interface JsonHandler
val
- The string to be written (which may or may not contain JSON escape sequences, according to the
options that were set)XPathException
- if a dynamic error occurspublic void writeBoolean(boolean value) throws XPathException
writeBoolean
in interface JsonHandler
value
- the boolean value to be writtenXPathException
- if a dynamic error occurspublic void writeNull() throws XPathException
writeNull
in interface JsonHandler
XPathException
- if a dynamic error occursCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.