|
BEA Systems, Inc. | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object weblogic.apache.xml.serialize.DOMWriterImpl
Implemenatation of DOM Level 3 org.w3c.ls.DOMWriter by delegating serialization
calls to XMLSerializer
.
DOMWriter provides an API for serializing (writing) a DOM document out in an
XML document. The XML data is written to an output stream.
During serialization of XML data, namespace fixup is done when possible as
defined in DOM Level 3 Core, Appendix B.
Constructor Summary | |
DOMWriterImpl(boolean namespaces)
Constructs a new DOMWriter. |
Method Summary | |
boolean |
canSetFeature(String name,
boolean state)
DOM L3-EXPERIMENTAL: Query whether setting a feature to a specific value is supported. |
String |
getEncoding()
DOM L3 EXPERIMENTAL: The character encoding in which the output will be written. |
org.apache.xerces.dom3.DOMErrorHandler |
getErrorHandler()
The error handler that will receive error notifications during serialization. |
boolean |
getFeature(String name)
DOM L3-EXPERIMENTAL: Look up the value of a feature. |
DOMWriterFilter |
getFilter()
When the application provides a filter, the serializer will call out to the filter before serializing each Node. |
String |
getNewLine()
DOM L3 EXPERIMENTAL: The end-of-line sequence of characters to be used in the XML being written out. |
void |
setEncoding(String encoding)
DOM L3 EXPERIMENTAL: The character encoding in which the output will be written. |
void |
setErrorHandler(org.apache.xerces.dom3.DOMErrorHandler errorHandler)
DOM L3 EXPERIMENTAL: The error handler that will receive error notifications during serialization. |
void |
setFeature(String name,
boolean state)
DOM L3-EXPERIMENTAL: Set the state of a feature. |
void |
setFilter(DOMWriterFilter filter)
When the application provides a filter, the serializer will call out to the filter before serializing each Node. |
void |
setNewLine(String newLine)
DOM L3 EXPERIMENTAL: The end-of-line sequence of characters to be used in the XML being written out. |
boolean |
writeNode(OutputStream destination,
Node wnode)
DOM L3 EXPERIMENTAL: Write out the specified node as described above in the description of DOMWriter . |
String |
writeToString(Node wnode)
DOM L3 EXPERIMENTAL: Serialize the specified node as described above in the description of DOMWriter . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DOMWriterImpl(boolean namespaces)
XMLSerializer
and
initializes the following fields: fNSBinder, fLocalNSBinder, fSymbolTable,
fEmptySymbol, fXmlSymbol, fXmlnsSymbol, fNamespaceCounter, fFeatures.
Method Detail |
public boolean canSetFeature(String name, boolean state)
canSetFeature
in interface DOMWriter
name
- The feature name, which is a DOM has-feature style string.state
- The requested state of the feature (true
or
false
).
true
if the feature could be successfully set to
the specified value, or false
if the feature is not
recognized or the requested value is not supported. The value of
the feature itself is not changed.public String getEncoding()
null
or empty, but the item to be
written includes an encoding declaration, that value will be used.If
neither of the above provides an encoding name, a default encoding of
"UTF-8" will be used.
null
.
getEncoding
in interface DOMWriter
public org.apache.xerces.dom3.DOMErrorHandler getErrorHandler()
getErrorHandler
in interface DOMWriter
public boolean getFeature(String name) throws DOMException
getFeature
in interface DOMWriter
name
- The feature name, which is a string with DOM has-feature
syntax.
true
or
false
).
DOMException
- Raise a NOT_FOUND_ERR When the DOMWriter
does not
recognize the feature name.public DOMWriterFilter getFilter()
getFilter
in interface DOMWriter
public String getNewLine()
null
null
.
getNewLine
in interface DOMWriter
public void setEncoding(String encoding)
null
or empty, but the item to be
written includes an encoding declaration, that value will be used.If
neither of the above provides an encoding name, a default encoding of
"UTF-8" will be used.
null
.
setEncoding
in interface DOMWriter
public void setErrorHandler(org.apache.xerces.dom3.DOMErrorHandler errorHandler)
setErrorHandler
in interface DOMWriter
public void setFeature(String name, boolean state) throws DOMException
DOMWriter
to recognize a feature
name but to be unable to set its value.
setFeature
in interface DOMWriter
name
- The feature name.state
- The requested state of the feature (true
or
false
).
DOMException
- Raise a NOT_SUPPORTED_ERR exception when the DOMWriter
recognizes the feature name but cannot set the requested value.
DOMWriter
does not
recognize the feature name.public void setFilter(DOMWriterFilter filter)
setFilter
in interface DOMWriter
public void setNewLine(String newLine)
null
null
.
setNewLine
in interface DOMWriter
public boolean writeNode(OutputStream destination, Node wnode)
DOMWriter
. Writing a Document or Entity node produces a
serialized form that is well formed XML. Writing other node types
produces a fragment of text in a form that is not fully defined by
this document, but that should be useful to a human for debugging or
diagnostic purposes.
writeNode
in interface DOMWriter
destination
- The destination for the data to be written.wnode
- The Document
or Entity
node to
be written. For other node types, something sensible should be
written, but the exact serialized form is not specified.
true
if node
was
successfully serialized and false
in case a failure
occured and the failure wasn't canceled by the error handler.
none
public String writeToString(Node wnode) throws DOMException
DOMWriter
. The result of serializing the node is
returned as a string. Writing a Document or Entity node produces a
serialized form that is well formed XML. Writing other node types
produces a fragment of text in a form that is not fully defined by
this document, but that should be useful to a human for debugging or
diagnostic purposes.
writeToString
in interface DOMWriter
wnode
- The node to be written.
null
in case a
failure occured and the failure wasn't canceled by the error
handler.
DOMException
- DOMSTRING_SIZE_ERR: The resulting string is too long to fit in a
DOMString
.
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs90 Copyright 2005 BEA Systems Inc. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |