Class Printer
- java.lang.Object
-
- org.smooks.engine.delivery.sax.ng.org.apache.xml.serialize.Printer
-
- Direct Known Subclasses:
IndentPrinter
public class Printer extends Object
Deprecated.This class was deprecated in Xerces 2.9.0. It is recommended that new applications use the DOM Level 3 LSSerializer or JAXP's Transformation API for XML (TrAX) for serializing XML. See the Xerces documentation for more information.The printer is responsible for sending text to the output stream or writer. This class performs direct writing for efficiency.IndentPrintersupports indentation and line wrapping by extending this class.- Version:
- $Revision$ $Date$
- Author:
- Assaf Arkin
-
-
Field Summary
Fields Modifier and Type Field Description protected Writer_docWriterDeprecated.Holds a reference to the document writer while we are in DTD mode.protected StringWriter_dtdWriterDeprecated.The DTD writer.protected IOException_exceptionDeprecated.Holds the exception thrown by the serializer.protected OutputFormat_formatDeprecated.The output format associated with this serializer.protected Writer_writerDeprecated.The writer to which the document is written.
-
Constructor Summary
Constructors Constructor Description Printer(Writer writer, OutputFormat format)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidbreakLine()Deprecated.voidbreakLine(boolean preserveSpace)Deprecated.voidenterDTD()Deprecated.Called by any of the DTD handlers to enter DTD mode.voidflush()Deprecated.Flush the output stream.voidflushLine(boolean preserveSpace)Deprecated.IOExceptiongetException()Deprecated.intgetNextIndent()Deprecated.voidindent()Deprecated.StringleaveDTD()Deprecated.Called by the root element to leave DTD mode and if any DTD parts were printer, will return a string with their textual content.voidprintSpace()Deprecated.voidprintText(char ch)Deprecated.voidprintText(char[] chars, int start, int length)Deprecated.voidprintText(String text)Deprecated.voidprintText(StringBuffer text)Deprecated.voidsetNextIndent(int indent)Deprecated.voidsetThisIndent(int indent)Deprecated.voidunindent()Deprecated.
-
-
-
Field Detail
-
_format
protected final OutputFormat _format
Deprecated.The output format associated with this serializer. This will never be a null reference. If no format was passed to the constructor, the default one for this document type will be used. The format object is never changed by the serializer.
-
_writer
protected Writer _writer
Deprecated.The writer to which the document is written.
-
_dtdWriter
protected StringWriter _dtdWriter
Deprecated.The DTD writer. When we switch to DTD mode, all output is accumulated in this DTD writer. When we switch out of it, the output is obtained as a string. Must not be reset to null until we're done with the document.
-
_docWriter
protected Writer _docWriter
Deprecated.Holds a reference to the document writer while we are in DTD mode.
-
_exception
protected IOException _exception
Deprecated.Holds the exception thrown by the serializer. Exceptions do not cause the serializer to quit, but are held and one is thrown at the end.
-
-
Constructor Detail
-
Printer
public Printer(Writer writer, OutputFormat format)
Deprecated.
-
-
Method Detail
-
getException
public IOException getException()
Deprecated.
-
enterDTD
public void enterDTD() throws IOExceptionDeprecated.Called by any of the DTD handlers to enter DTD mode. Once entered, all output will be accumulated in a string that can be printed as part of the document's DTD. This method may be called any number of time but will only have affect the first time it's called. To exist DTD state and get the accumulated DTD, callleaveDTD().- Throws:
IOException
-
leaveDTD
public String leaveDTD() throws IOException
Deprecated.Called by the root element to leave DTD mode and if any DTD parts were printer, will return a string with their textual content.- Throws:
IOException
-
printText
public void printText(String text) throws IOException
Deprecated.- Throws:
IOException
-
printText
public void printText(StringBuffer text) throws IOException
Deprecated.- Throws:
IOException
-
printText
public void printText(char[] chars, int start, int length) throws IOExceptionDeprecated.- Throws:
IOException
-
printText
public void printText(char ch) throws IOExceptionDeprecated.- Throws:
IOException
-
printSpace
public void printSpace() throws IOExceptionDeprecated.- Throws:
IOException
-
breakLine
public void breakLine() throws IOExceptionDeprecated.- Throws:
IOException
-
breakLine
public void breakLine(boolean preserveSpace) throws IOExceptionDeprecated.- Throws:
IOException
-
flushLine
public void flushLine(boolean preserveSpace) throws IOExceptionDeprecated.- Throws:
IOException
-
flush
public void flush() throws IOExceptionDeprecated.Flush the output stream. Must be called when done printing the document, otherwise some text might be buffered.- Throws:
IOException
-
indent
public void indent()
Deprecated.
-
unindent
public void unindent()
Deprecated.
-
getNextIndent
public int getNextIndent()
Deprecated.
-
setNextIndent
public void setNextIndent(int indent)
Deprecated.
-
setThisIndent
public void setThisIndent(int indent)
Deprecated.
-
-