public class XMLPrintDriver extends java.lang.Object implements PrintDriver
XMLPrintDriver implements PrintDriver interface.| Constructor and Description |
|---|
XMLPrintDriver(java.io.OutputStream os)
Create a new PrintDriver to output XML to OutputStream
|
XMLPrintDriver(java.io.PrintWriter pw)
Create a new PrintDriver to output XML to PrintWriter
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the output stream or print writer.
|
void |
close(int option)
Closes the output stream or print writer based on option Legal values are: XMLOutputStream.REUSE and XMLOutputStream.NO_REUSE.
|
void |
flush()
Flushes the output stream or print writer
|
void |
printAttribute(XMLAttr attr)
Prints a
XMLAttr node |
void |
printAttributeNodes(XMLElement elem)
Calls print method for each attribute of the
XMLElement |
void |
printCDATASection(XMLCDATA cdata)
Prints a
XMLCDATA node |
void |
printChildNodes(XMLNode node)
Calls print method for each child of the
XMLNode |
void |
printComment(XMLComment comment)
Prints a
XMLComment node |
void |
printDoctype(DTD dtd)
Prints an
DTD. |
void |
printDocument(XMLDocument doc)
Prints an
XMLDocument. |
void |
printDocumentFragment(XMLDocumentFragment dfrag)
Prints an empty
XMLDocumentFragment object. |
void |
printElement(XMLElement elem)
Prints an
XMLElement. |
void |
printEntityReference(XMLEntityReference en)
Prints a
XMLEntityReference node |
void |
printNode(XMLNode node) |
void |
printProcessingInstruction(XMLPI pi)
Prints a
XMLPI node |
void |
printTextNode(XMLText text)
Prints a
XMLText node |
void |
setEncoding(java.lang.String enc)
Sets the encoding of the print driver.
|
void |
setFormatPrettyPrint(boolean val)
Sets the pretty format print
|
void |
setPrintInheritedNamespaces(boolean val)
Sets print inherited namespaces.
|
public XMLPrintDriver(java.io.PrintWriter pw)
pw - - PrintWriter to use for outputpublic XMLPrintDriver(java.io.OutputStream os)
os - - OutputStream to use for outputpublic void setEncoding(java.lang.String enc)
throws java.io.IOException
setEncoding in interface PrintDriverenc - The encoding of the document being printed.java.io.IOExceptionpublic void setFormatPrettyPrint(boolean val)
val - boolean valuepublic void setPrintInheritedNamespaces(boolean val)
val - boolean - true to print all inherited namespaces, false to omit inherited namespacepublic void printNode(XMLNode node) throws java.io.IOException
java.io.IOExceptionpublic void printDoctype(DTD dtd) throws java.io.IOException
DTD.printDoctype in interface PrintDriverdtd - The dtd to be printed.java.io.IOExceptionpublic void printDocument(XMLDocument doc) throws java.io.IOException
XMLDocument.printDocument in interface PrintDriverdoc - The document to be printed.java.io.IOExceptionpublic void printElement(XMLElement elem) throws java.io.IOException
XMLElement.printElement in interface PrintDriverelem - The element to be printed.java.io.IOExceptionpublic void printDocumentFragment(XMLDocumentFragment dfrag) throws java.io.IOException
XMLDocumentFragment object.printDocumentFragment in interface PrintDriverdfrag - The document fragment to be printed.java.io.IOExceptionpublic void printTextNode(XMLText text) throws java.io.IOException
XMLText nodeprintTextNode in interface PrintDrivertext - The text node.java.io.IOExceptionpublic void printComment(XMLComment comment) throws java.io.IOException
XMLComment nodeprintComment in interface PrintDrivercomment - The comment node.java.io.IOExceptionpublic void printCDATASection(XMLCDATA cdata) throws java.io.IOException
XMLCDATA nodeprintCDATASection in interface PrintDrivercdata - The XMLCDATA node.java.io.IOExceptionpublic void printProcessingInstruction(XMLPI pi) throws java.io.IOException
XMLPI nodeprintProcessingInstruction in interface PrintDriverpi - The XMLPI node.java.io.IOExceptionpublic void printAttribute(XMLAttr attr) throws java.io.IOException
XMLAttr nodeprintAttribute in interface PrintDriverattr - The XMLAttr node.java.io.IOExceptionpublic void printEntityReference(XMLEntityReference en) throws java.io.IOException
XMLEntityReference nodeprintEntityReference in interface PrintDriveren - The XMLEntityReference node.java.io.IOExceptionpublic final void printChildNodes(XMLNode node) throws java.io.IOException
XMLNodeprintChildNodes in interface PrintDrivernode - The node whose children are to be printed.java.io.IOExceptionpublic final void printAttributeNodes(XMLElement elem) throws java.io.IOException
XMLElementprintAttributeNodes in interface PrintDriverelem - The elem whose attributes are to be printed.java.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface PrintDriverjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface PrintDriverjava.io.IOExceptionpublic void close(int option)
throws java.io.IOException
option - determines whether output stream or print writer has to be closed.java.io.IOException