public class JsonHandlerMap extends JsonHandler
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Stack<java.lang.String> |
keys |
charChecker, escape| Constructor and Description |
|---|
JsonHandlerMap(XPathContext context,
int flags) |
| Modifier and Type | Method and Description |
|---|---|
void |
endArray()
Close the current array
|
void |
endMap()
Close the current object/map
|
Sequence |
getResult() |
boolean |
setKey(java.lang.String unEscaped,
java.lang.String reEscaped)
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(java.lang.String asString,
double asDouble)
Write a numeric value
|
void |
writeString(java.lang.String val)
Write a string value
|
getContext, handleInvalidCharacters, markAsEscaped, reEscape, setContext, setFallbackFunctionpublic JsonHandlerMap(XPathContext context, int flags)
public Sequence getResult() throws XPathException
getResult in class JsonHandlerXPathExceptionpublic boolean setKey(java.lang.String unEscaped,
java.lang.String reEscaped)
setKey in class JsonHandlerunEscaped - the key for the entry (null implies no key) in unescaped form (backslashes,
if present, do not signal an escape sequence)reEscaped - the key for the entry (null implies no key) in reescaped form. In this form
special characters are represented as backslash-escaped sequences if the escape
option is yes; if escape=no, the reEscaped form is the same as the unEscaped form.public void startArray()
throws XPathException
startArray in class JsonHandlerXPathExceptionpublic void endArray()
throws XPathException
endArray in class JsonHandlerXPathExceptionpublic void startMap()
throws XPathException
startMap in class JsonHandlerXPathExceptionpublic void endMap()
throws XPathException
endMap in class JsonHandlerXPathExceptionpublic void writeNumeric(java.lang.String asString,
double asDouble)
throws XPathException
writeNumeric in class JsonHandlerasString - the string representation of the valueasDouble - the double representation of the valueXPathException - if a dynamic error occurspublic void writeString(java.lang.String val)
throws XPathException
writeString in class 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 class JsonHandlervalue - the boolean value to be writtenXPathException - if a dynamic error occurspublic void writeNull()
throws XPathException
writeNull in class JsonHandlerXPathException - if a dynamic error occursCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.