|
Qizx/Open v0.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.xfra.qizxopen.dm.XMLEventReceiverBase | +--net.xfra.qizxopen.dm.XMLSerializer
Serializes a DataModel Node and its subtree to an output stream.
Constructor Summary | |
XMLSerializer()
Constructs a XMLSerializer with default XML output method. |
|
XMLSerializer(java.lang.String method)
Constructs a XMLSerializer with specification of an output method. |
|
XMLSerializer(java.io.Writer output)
Constructs a XMLSerializer with an output writer. |
Method Summary | |
void |
atom(java.lang.String value)
Emits the text of an atom. |
void |
comment(java.lang.String value)
Emits a comment. |
void |
endDocument()
Ends a document. |
void |
endElement(QName name)
Ends an element. |
void |
flushElement(boolean empty)
|
java.lang.String |
getEncoding()
|
java.io.PrintWriter |
getOutput()
Gets the current output writer. |
void |
output(Node node)
Serializes a node and its subtree. |
void |
pi(java.lang.String target,
java.lang.String value)
Emits a processing-instruction. |
void |
reset()
Resets the state prior to use startDocument() or startElement(). |
void |
setDepth(int maxDepth)
Extension: defines a maximum tree depth. |
void |
setIndent(int indent)
|
void |
setOption(java.lang.String option,
java.lang.String value)
Sets an option. |
void |
setOutput(java.io.OutputStream output,
java.lang.String encoding)
Defines or redefines the output. |
void |
setOutput(java.io.Writer output)
Defines or redefines the output. |
void |
startDocument()
Starts a document. |
void |
terminate()
Terminates a document or simple subtree. |
void |
text(java.lang.String value)
Emits a text chunk. |
void |
traverse(Node node)
Lower-level output method. |
Methods inherited from class net.xfra.qizxopen.dm.XMLEventReceiverBase |
attribute, definePrefixHints, maxVolumeReached, namespace, resolvePrefix, setMaxVolume, setTrace, startElement, traverse |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLSerializer()
public XMLSerializer(java.lang.String method) throws DataModelException
method
- output method name (case-insensitive): XML, XHTML, HTML, or TEXT.
DataModelException
- when the method name is invalid.public XMLSerializer(java.io.Writer output)
Method Detail |
public void output(Node node) throws DataModelException
node
- node to serialize. If it is not a document, the XML header
is not generated.
DataModelException
public void setOutput(java.io.OutputStream output, java.lang.String encoding)
public void traverse(Node node) throws DataModelException
DataModelException
public void setOutput(java.io.Writer output)
public java.io.PrintWriter getOutput()
public void setOption(java.lang.String option, java.lang.String value) throws DataModelException
Supported options (see setOption):
option
- name of the option (see above).value
- option value in string form.
DataModelException
- on bad option name or value.public void setDepth(int maxDepth)
public void setIndent(int indent)
public java.lang.String getEncoding()
public void reset()
XMLEventReceiver
reset
in interface XMLEventReceiver
reset
in class XMLEventReceiverBase
public void terminate() throws DataModelException
XMLEventReceiver
terminate
in interface XMLEventReceiver
terminate
in class XMLEventReceiverBase
DataModelException
public void startDocument() throws DataModelException
XMLEventReceiver
It is not necessarily called, if only a fragment is generated.
startDocument
in interface XMLEventReceiver
startDocument
in class XMLEventReceiverBase
DataModelException
public void endDocument() throws DataModelException
XMLEventReceiver
endDocument
in interface XMLEventReceiver
endDocument
in class XMLEventReceiverBase
DataModelException
public void flushElement(boolean empty)
flushElement
in class XMLEventReceiverBase
public void endElement(QName name) throws DataModelException
XMLEventReceiver
endElement
in interface XMLEventReceiver
endElement
in class XMLEventReceiverBase
DataModelException
public void text(java.lang.String value)
XMLEventReceiver
public void atom(java.lang.String value)
XMLEventReceiver
public void pi(java.lang.String target, java.lang.String value)
XMLEventReceiver
public void comment(java.lang.String value)
XMLEventReceiver
|
Copyright Xavier FRANC 2003-2004 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |