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 JsonHandlerXPathExceptionpublic void setKey(String key)
setKey in interface JsonHandlerkey - the key for the entry - null implies no keypublic void startArray()
throws XPathException
startArray in interface JsonHandlerXPathExceptionpublic void endArray()
throws XPathException
endArray in interface JsonHandlerXPathExceptionpublic void startMap()
throws XPathException
startMap in interface JsonHandlerXPathExceptionpublic void endMap()
throws XPathException
endMap in interface JsonHandlerXPathExceptionpublic void writeNumeric(String asString, double asDouble) throws XPathException
writeNumeric in interface JsonHandlerasString - 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 JsonHandlerval - 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 JsonHandlervalue - the boolean value to be writtenXPathException - if a dynamic error occurspublic void writeNull()
throws XPathException
writeNull in interface JsonHandlerXPathException - if a dynamic error occursCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.