Interface Serializer
- All Known Implementing Classes:
BaseMarkupSerializer,HTMLSerializer,TextSerializer,XHTMLSerializer,XML11Serializer,XMLSerializer
To serialize a document using SAX events, create a compatible serializer
and pass it around as a DocumentHandler. If an I/O error occurs while serializing, it will
be thrown by DocumentHandler.endDocument(). The SAX serializer
may also be used as DTDHandler, DeclHandler and
LexicalHandler.
To serialize a DOM document or DOM element, create a compatible
serializer and call it's DOMSerializer.serialize(Document) or DOMSerializer.serialize(Element) methods.
Both methods would produce a full XML document, to serizlie only
the portion of the document use OutputFormat.setOmitXMLDeclaration(boolean)
and specify no document type.
The OutputFormat dictates what underlying serialized is used
to serialize the document based on the specified method. If the output
format or method are missing, the default is an XML serializer with
UTF-8 encoding and now indentation.
- Version:
- $Revision: 699892 $ $Date: 2008-09-29 02:38:27 +0530 (Mon, 29 Sep 2008) $
- Author:
- Assaf Arkin, Scott Boag
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Return aContentHandlerinterface into this serializer.Deprecated.Return aDocumentHandlerinterface into this serializer.Deprecated.Return aDOMSerializerinterface into this serializer.voidsetOutputByteStream(OutputStream output) Deprecated.Specifies an output stream to which the document should be serialized.voidsetOutputCharStream(Writer output) Deprecated.Specifies a writer to which the document should be serialized.voidsetOutputFormat(OutputFormat format) Deprecated.Specifies an output format for this serializer.
-
Method Details
-
setOutputByteStream
Deprecated.Specifies an output stream to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document. -
setOutputCharStream
Deprecated.Specifies a writer to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document. -
setOutputFormat
Deprecated.Specifies an output format for this serializer. It the serializer has already been associated with an output format, it will switch to the new format. This method should not be called while the serializer is in the process of serializing a document.- Parameters:
format- The output format to use
-
asDocumentHandler
Deprecated.Return aDocumentHandlerinterface into this serializer. If the serializer does not support theDocumentHandlerinterface, it should return null.- Throws:
IOException
-
asContentHandler
Deprecated.Return aContentHandlerinterface into this serializer. If the serializer does not support theContentHandlerinterface, it should return null.- Throws:
IOException
-
asDOMSerializer
Deprecated.Return aDOMSerializerinterface into this serializer. If the serializer does not support theDOMSerializerinterface, it should return null.- Throws:
IOException
-