|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.XMLFilterImpl
org.xquark.util.DefaultXMLFilter
org.xquark.serialize.BasicXMLSerializer
A simple SAX2 XML serializer implementing SAX ContentHandler and
LexicalHandler.
IMPORTANT: SAX2 XMLReader
http://xml.org/sax/features/namespaces
and
http://xml.org/sax/features/namespace-prefixes
features must be
set to true.
Constructor Summary | |
BasicXMLSerializer(java.io.OutputStream out)
Creates new BasicXMLSerializer |
|
BasicXMLSerializer(java.io.OutputStream out,
java.lang.String encoding)
Creates new BasicXMLSerializer |
|
BasicXMLSerializer(java.io.Writer out)
Creates new BasicXMLSerializer |
|
BasicXMLSerializer(java.io.Writer out,
java.lang.String encoding)
Creates new BasicXMLSerializer |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
|
void |
close()
Closes the user stream. |
void |
comment(char[] ch,
int start,
int length)
|
void |
endCDATA()
|
void |
endDocument()
|
void |
endElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName)
|
boolean |
getAutoStreamClose()
Enable automatic close of the output user stream on endDocument() event. |
boolean |
getCanonicalOutput()
Accessor to the current ordering mode for attributes. |
java.lang.String |
getDefaultEncoding()
|
boolean |
getGenerateXMLDeclaration()
Accessor to the current flag for XML declaration generation. |
boolean |
getIndent()
|
boolean |
getUseIgnorableWhitespaces()
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
void |
processingInstruction(java.lang.String target,
java.lang.String data)
|
void |
reset()
Reset internal state before reuse. |
void |
setAutoStreamClose(boolean close)
Enable automatic close of the output user stream on endDocument() event. |
void |
setCanonicalOutput(boolean mode)
Set the ordering mode for attributes. |
void |
setDefaultEncoding(java.lang.String encoding)
Set the character encoding. |
void |
setGenerateXMLDeclaration(boolean enable)
Enable XML declaration generation on startDocument() event. |
void |
setIndent(boolean indent)
Set the indenting mode. |
void |
setOutputStream(java.io.OutputStream out)
Set the OutputStream where the serializer writes bytes. |
void |
setUseIgnorableWhitespaces(boolean use)
turn on or off the use of ignorable whitespace for indentation. |
void |
setWriter(java.io.Writer out)
Set the Writer where the serializer writes characters. |
void |
startCDATA()
|
void |
startDocument()
|
void |
startElement(java.lang.String namespaceURI,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
|
Methods inherited from class org.xquark.util.DefaultXMLFilter |
endDTD, endEntity, getLexicalHandler, getProperty, setLexicalHandler, setProperty, startDTD, startEntity |
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl |
endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, notationDecl, parse, parse, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BasicXMLSerializer(java.io.OutputStream out) throws java.io.UnsupportedEncodingException
out
- the OutputStream where the serializer writes bytes. For
instance a FileOutputStream.public BasicXMLSerializer(java.io.Writer out)
out
- the writer where the serializer writes characters. For
instance a FileOutputStream.public BasicXMLSerializer(java.io.OutputStream out, java.lang.String encoding) throws java.io.UnsupportedEncodingException
out
- the writer where the serializer writes characters. For
instance a FileOutputStream.encoding
- a string for the MIME encoding (must be supported by the
JDK used)OutputStream
public BasicXMLSerializer(java.io.Writer out, java.lang.String encoding)
out
- the OutputStream where the serializer writes bytes. For
instance a FileOutputStream.encoding
- a string for the MIME encoding (must be compatible with
the encoding used by the writer)Method Detail |
public void setOutputStream(java.io.OutputStream out) throws java.io.UnsupportedEncodingException
out
- the OutputStream where the serializer writes bytes. For
instance a FileOutputStream.
java.io.UnsupportedEncodingException
public void setWriter(java.io.Writer out)
out
- the writer where the serializer writes characters. For
instance a FileOutputStream.public void setIndent(boolean indent)
indent
- if true, tabs are used at the beginning of lines to indent the output file.public void setUseIgnorableWhitespaces(boolean use)
public void setCanonicalOutput(boolean mode)
public void setDefaultEncoding(java.lang.String encoding)
encoding
- a string specifying the character encoding, which must be supported by the
JDK. Example: UTF-8, ISO-8859-1public void setGenerateXMLDeclaration(boolean enable)
enable
- Declaration is geenrated if true. Default is true.public void setAutoStreamClose(boolean close)
close
- Output stream will be closed if true. Default is false.public boolean getIndent()
public boolean getUseIgnorableWhitespaces()
public boolean getCanonicalOutput()
public java.lang.String getDefaultEncoding()
public boolean getGenerateXMLDeclaration()
public boolean getAutoStreamClose()
public void reset()
public void close()
public void startDocument() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void startCDATA() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void endCDATA() throws org.xml.sax.SAXException
org.xml.sax.SAXException
public void comment(char[] ch, int start, int length) throws org.xml.sax.SAXException
org.xml.sax.SAXException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |