|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmondrian.xmla.impl.JsonSaxWriter
class JsonSaxWriter
Implementation of SaxWriter which, perversely, generates a
JSON (JavaScript Object Notation) document.
| Constructor Summary | |
|---|---|
JsonSaxWriter(OutputStream outputStream)
Creates a JsonSaxWriter. |
|
| Method Summary | |
|---|---|
void |
characters(String data)
|
void |
completeBeforeElement(String tagName)
|
void |
element(String name,
Object... attrs)
|
void |
endDocument()
|
void |
endElement()
|
void |
endSequence()
Informs the writer that a sequence of elements of the same name has ended. |
void |
flush()
Flushes any unwritten output. |
void |
startDocument()
|
void |
startElement(String name)
|
void |
startElement(String name,
Object... attrs)
|
void |
startSequence(String name,
String subName)
Informs the writer that a sequence of elements of the same name is starting. |
void |
textElement(String name,
Object data)
Generates a text-only element, <name>data</name>. |
void |
verbatim(String text)
Sends a piece of text verbatim through the writer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JsonSaxWriter(OutputStream outputStream)
outputStream - Output stream| Method Detail |
|---|
public void startDocument()
startDocument in interface SaxWriterpublic void endDocument()
endDocument in interface SaxWriter
public void startSequence(String name,
String subName)
SaxWriterFor XML, is equivalent to startElement(name).
For JSON, initiates the array construct:
"name" : [
{ ... },
{ ... }
]
startSequence in interface SaxWritername - Element namesubName - Child element namepublic void endSequence()
SaxWriter
endSequence in interface SaxWriterpublic void startElement(String name)
startElement in interface SaxWriter
public void startElement(String name,
Object... attrs)
startElement in interface SaxWriterpublic void endElement()
endElement in interface SaxWriter
public void element(String name,
Object... attrs)
element in interface SaxWriterpublic void characters(String data)
characters in interface SaxWriter
public void textElement(String name,
Object data)
SaxWriter<name>data</name>.
For XML, this is equivalent to
startElement(name);
characters(data);
endElement();
but for JSON, generates "name": "data".
textElement in interface SaxWritername - Name of elementdata - Text content of elementpublic void completeBeforeElement(String tagName)
completeBeforeElement in interface SaxWriterpublic void verbatim(String text)
SaxWriter
verbatim in interface SaxWriterpublic void flush()
SaxWriter
flush in interface SaxWriter
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||