Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xml.serialize.transition
Class Printer

    java.lang.Object
      |
      +--org.apache.xml.serialize.transition.Printer

public class Printer
extends java.lang.Object

The printer is responsible for sending text to the output stream or writer. This class performs direct writing for efficiency. `IndentPrinter` supports indentation and line wrapping by extending this class.

Constructor Summary
`Printer(java.io.Writer writer, OutputFormat format)`

Method Summary
`void` | `breakLine()`
`void` | `breakLine(boolean preserveSpace)`
`void` | `enterDTD()` Called by any of the DTD handlers to enter DTD mode.
`void` | `flush()` Flush the output stream.
`void` | `flushLine(boolean preserveSpace)`
`java.io.IOException` | `getException()`
`int` | `getNextIndent()`
`void` | `indent()`
`java.lang.String` | `leaveDTD()` Called by the root element to leave DTD mode and if any DTD parts were printer, will return a string with their textual content.
`void` | `printSpace()`
`void` | `printText(char ch)`
`void` | `printText(char[] chars, int start, int length)`
`void` | `printText(java.lang.String text)`
`void` | `printText(java.lang.StringBuffer text)`
`void` | `setNextIndent(int indent)`
`void` | `setThisIndent(int indent)`
`void` | `unindent()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Printer

    public Printer(java.io.Writer writer,
                   OutputFormat format)

Method Detail

### getException

    public java.io.IOException getException()

### enterDTD

    public void enterDTD()

  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, call `leaveDTD()`.

### leaveDTD

    public java.lang.String leaveDTD()

  Called by the root element to leave DTD mode and if any DTD parts were printer, will return a string with their textual content.

### printText

    public void printText(java.lang.String text)

### printText

    public void printText(java.lang.StringBuffer text)

### printText

    public void printText(char[] chars,
                          int start,
                          int length)

### printText

    public void printText(char ch)

### printSpace

    public void printSpace()

### breakLine

    public void breakLine()

### breakLine

    public void breakLine(boolean preserveSpace)

### flushLine

    public void flushLine(boolean preserveSpace)

### flush

    public void flush()

  Flush the output stream. Must be called when done printing the document, otherwise some text might be buffered.

### indent

    public void indent()

### unindent

    public void unindent()

### getNextIndent

    public int getNextIndent()

### setNextIndent

    public void setNextIndent(int indent)

### setThisIndent

    public void setThisIndent(int indent)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache XML Project. All Rights Reserved.