|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnu.staldal.xodus.Serializer
public abstract class Serializer
Serialize SAX2 events to its textual XML representation.
Support output to XML, XHTML and Text. Full support for XML namespaces.
The ContentHandler.startDocument()
and ContentHandler.endDocument()
method must be used.
Output properties controls the serialization process, it uses the keys in
javax.xml.transform.OutputKeys
.
The METHOD output property must be specified. It can be "xml", "xhtml", "text" or "html".
The CDATA_SECTION_ELEMENTS output property is not supported.
The ENCODING output property defaults to UTF-8 for XML and XHTML, and to ISO-8859-1 for Text and HTML.
The MEDIA_TYPE output property is not used.
The "html" output method does not escape non-ASCII characters in URI attribute values, as specified in the XSLT 1.0 specification.
The "html" output method does not not add any META element with encoding, as specified in the XSLT 1.0 specification.
javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING
and
javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING
can be used as processingInstruction targets to disable output escaping.
Field Summary | |
---|---|
protected XMLCharacterEncoder |
out
|
protected OutputConfig |
outputConfig
|
protected java.lang.String |
systemId
|
Constructor Summary | |
---|---|
protected |
Serializer(javax.xml.transform.stream.StreamResult result,
OutputConfig outputConfig)
|
Method Summary | |
---|---|
static Serializer |
createSerializer(javax.xml.transform.stream.StreamResult result,
java.util.Properties outputProperties)
Factory method, create a new Serializer. |
protected void |
finishOutput()
Finish writing to output. |
protected void |
newline()
Write a newline. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.ContentHandler |
---|
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
---|
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Methods inherited from interface org.xml.sax.DTDHandler |
---|
notationDecl, unparsedEntityDecl |
Methods inherited from interface org.xml.sax.ext.DeclHandler |
---|
attributeDecl, elementDecl, externalEntityDecl, internalEntityDecl |
Field Detail |
---|
protected final OutputConfig outputConfig
protected final java.lang.String systemId
protected final XMLCharacterEncoder out
Constructor Detail |
---|
protected Serializer(javax.xml.transform.stream.StreamResult result, OutputConfig outputConfig) throws java.lang.IllegalArgumentException, java.io.IOException, java.io.UnsupportedEncodingException
java.lang.IllegalArgumentException
java.io.IOException
java.io.UnsupportedEncodingException
Method Detail |
---|
public static Serializer createSerializer(javax.xml.transform.stream.StreamResult result, java.util.Properties outputProperties) throws java.lang.IllegalArgumentException, java.io.IOException, java.io.UnsupportedEncodingException
result
- specifies where to write the textual representation.outputProperties
- output properties, uses OutputKeys
java.io.UnsupportedEncodingException
- if the ENCODING output property
is invalid.
java.lang.IllegalArgumentException
- if any other output property is invalid.
java.io.IOException
- if the result is invalid.protected void finishOutput() throws java.io.IOException
OutputStream
or Writer
was provided.
java.io.IOException
protected void newline() throws java.io.IOException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |