Package mondrian.xmla.impl
Class DefaultSaxWriter
java.lang.Object
mondrian.xmla.impl.DefaultSaxWriter
- All Implemented Interfaces:
SaxWriter
Default implementation of
SaxWriter.- Since:
- 27 April, 2003
- Author:
- jhyde, Gang Chen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classList of SAX attributes based upon a string array. -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSaxWriter(OutputStream stream) Creates a DefaultSaxWriter writing to anOutputStream.DefaultSaxWriter(OutputStream stream, String xmlEncoding) DefaultSaxWriter(PrintWriter writer, int initialIndent) Creates a DefaultSaxWriter writing to aPrintWriter.DefaultSaxWriter(Writer writer) Creates aSAXWriterwriting to aWriter. -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(String s) voidcompleteBeforeElement(String tagName) voidvoidvoidvoidInforms the writer that a sequence of elements of the same name has ended.voidflush()Flushes any unwritten output.voidvoidstartElement(String tagName) voidstartElement(String tagName, Object... attributes) voidstartSequence(String name, String subName) Informs the writer that a sequence of elements of the same name is starting.final voidtextElement(String name, Object data) Generates a text-only element,<name>data</name>.voidSends a piece of text verbatim through the writer.
-
Constructor Details
-
DefaultSaxWriter
Creates a DefaultSaxWriter writing to anOutputStream. -
DefaultSaxWriter
public DefaultSaxWriter(OutputStream stream, String xmlEncoding) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
DefaultSaxWriter
Creates aSAXWriterwriting to aWriter.If
writeris aPrintWriter,DefaultSaxWriter(java.io.OutputStream)is preferred. -
DefaultSaxWriter
Creates a DefaultSaxWriter writing to aPrintWriter.- Parameters:
writer- WriterinitialIndent- Initial indent
-
-
Method Details
-
characters
- Specified by:
charactersin interfaceSaxWriter
-
startSequence
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
-
textElement
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
-
element
-
startElement
- Specified by:
startElementin interfaceSaxWriter
-
startElement
- Specified by:
startElementin interfaceSaxWriter
-
endElement
public void endElement()- Specified by:
endElementin interfaceSaxWriter
-
startDocument
public void startDocument()- Specified by:
startDocumentin interfaceSaxWriter
-
endDocument
public void endDocument()- Specified by:
endDocumentin interfaceSaxWriter
-
completeBeforeElement
- Specified by:
completeBeforeElementin interfaceSaxWriter
-
verbatim
Description copied from interface:SaxWriterSends a piece of text verbatim through the writer. It must be a piece of well-formed XML. -
flush
public void flush()Description copied from interface:SaxWriterFlushes any unwritten output.
-