Package mondrian.xmla.impl
Class JsonSaxWriter
- java.lang.Object
-
- mondrian.xmla.impl.JsonSaxWriter
-
-
Constructor Summary
Constructors Constructor Description JsonSaxWriter(OutputStream outputStream)Creates a JsonSaxWriter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(String data)voidcompleteBeforeElement(String tagName)voidelement(String name, Object... attrs)voidendDocument()voidendElement()voidendSequence()Informs the writer that a sequence of elements of the same name has ended.voidflush()Flushes any unwritten output.voidstartDocument()voidstartElement(String name)voidstartElement(String name, Object... attrs)voidstartSequence(String name, String subName)Informs the writer that a sequence of elements of the same name is starting.voidtextElement(String name, Object data)Generates a text-only element,<name>data</name>.voidverbatim(String text)Sends a piece of text verbatim through the writer.
-
-
-
Constructor Detail
-
JsonSaxWriter
public JsonSaxWriter(OutputStream outputStream)
Creates a JsonSaxWriter.- Parameters:
outputStream- Output stream
-
-
Method Detail
-
startDocument
public void startDocument()
- Specified by:
startDocumentin interfaceSaxWriter
-
endDocument
public void endDocument()
- Specified by:
endDocumentin interfaceSaxWriter
-
startSequence
public void startSequence(String name, String subName)
Description copied from interface:SaxWriterInforms the writer that a sequence of elements of the same name is starting.For XML, is equivalent to
startElement(name).For JSON, initiates the array construct:
"name" : [
{ ... },
{ ... }
]- Specified by:
startSequencein interfaceSaxWriter- Parameters:
name- Element namesubName- Child element name
-
endSequence
public void endSequence()
Description copied from interface:SaxWriterInforms the writer that a sequence of elements of the same name has ended.- Specified by:
endSequencein interfaceSaxWriter
-
startElement
public void startElement(String name)
- Specified by:
startElementin interfaceSaxWriter
-
startElement
public void startElement(String name, Object... attrs)
- Specified by:
startElementin interfaceSaxWriter
-
endElement
public void endElement()
- Specified by:
endElementin interfaceSaxWriter
-
characters
public void characters(String data)
- Specified by:
charactersin interfaceSaxWriter
-
textElement
public void textElement(String name, Object data)
Description copied from interface:SaxWriterGenerates a text-only element,<name>data</name>.For XML, this is equivalent to
but for JSON, generatesstartElement(name);
characters(data);
endElement();"name": "data".- Specified by:
textElementin interfaceSaxWriter- Parameters:
name- Name of elementdata- Text content of element
-
completeBeforeElement
public void completeBeforeElement(String tagName)
- Specified by:
completeBeforeElementin interfaceSaxWriter
-
verbatim
public void verbatim(String text)
Description copied from interface:SaxWriterSends a piece of text verbatim through the writer. It must be a piece of well-formed XML.
-
-