Class Printer
- java.lang.Object
-
- org.apache.jackrabbit.vault.util.xml.serialize.Printer
-
- Direct Known Subclasses:
IndentPrinter
public class Printer extends java.lang.ObjectThe 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.
-
-
Constructor Summary
Constructors Constructor Description Printer(java.io.Writer writer, OutputFormat format)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbreakLine()voidbreakLine(boolean preserveSpace)voidenterDTD()Called by any of the DTD handlers to enter DTD mode.voidflush()Flush the output stream.voidflushLine(boolean preserveSpace)java.io.IOExceptiongetException()intgetNextIndent()voidindent()java.lang.StringleaveDTD()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()voidprintText(char ch)voidprintText(char[] chars, int start, int length)voidprintText(java.lang.String text)voidprintText(java.lang.StringBuffer text)voidsetNextIndent(int indent)voidsetThisIndent(int indent)voidunindent()
-
-
-
Constructor Detail
-
Printer
public Printer(java.io.Writer writer, OutputFormat format)
-
-
Method Detail
-
getException
public java.io.IOException getException()
-
enterDTD
public void enterDTD() throws java.io.IOExceptionCalled 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:
java.io.IOException
-
leaveDTD
public java.lang.String leaveDTD() throws java.io.IOExceptionCalled by the root element to leave DTD mode and if any DTD parts were printer, will return a string with their textual content.- Throws:
java.io.IOException
-
printText
public void printText(java.lang.String text) throws java.io.IOException- Throws:
java.io.IOException
-
printText
public void printText(java.lang.StringBuffer text) throws java.io.IOException- Throws:
java.io.IOException
-
printText
public void printText(char[] chars, int start, int length) throws java.io.IOException- Throws:
java.io.IOException
-
printText
public void printText(char ch) throws java.io.IOException- Throws:
java.io.IOException
-
printSpace
public void printSpace() throws java.io.IOException- Throws:
java.io.IOException
-
breakLine
public void breakLine() throws java.io.IOException- Throws:
java.io.IOException
-
breakLine
public void breakLine(boolean preserveSpace) throws java.io.IOException- Throws:
java.io.IOException
-
flushLine
public void flushLine(boolean preserveSpace) throws java.io.IOException- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOExceptionFlush the output stream. Must be called when done printing the document, otherwise some text might be buffered.- Throws:
java.io.IOException
-
indent
public void indent()
-
unindent
public void unindent()
-
getNextIndent
public int getNextIndent()
-
setNextIndent
public void setNextIndent(int indent)
-
setThisIndent
public void setThisIndent(int indent)
-
-