Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 2.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xmlgraphics.ps.dsc
Class DefaultDSCHandler

    java.lang.Object
      org.apache.xmlgraphics.ps.dsc.DefaultDSCHandler

All Implemented Interfaces:
  DSCHandler

    public class DefaultDSCHandler

extends Object
implements DSCHandler

Default implementation of a DSCHandler which simply passes through the PostScript content unchanged. Subclasses can implement different behaviour, for example to filter certain DSC comments or to insert PostScript code at specific places.

Field Summary
`protected PSGenerator` | `gen`
`protected OutputStream` | `out`

Constructor Summary
`DefaultDSCHandler(OutputStream out)` Creates a new instance.

Method Summary
`void` | `comment(String comment)` Called for any line containing a full-line PostScript comment.
`void` | `endDocument()` Called when the PostScript file is fully processed, i.e.
`void` | `handleDSCComment(DSCComment comment)` Called for each standard DSC comment.
`void` | `line(String line)` Called for a normal line of PostScript code.
`void` | `startDocument(String header)` Called as a new PostScript file starts.

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

Field Detail

### out

    protected OutputStream out

### gen

    protected PSGenerator gen

Constructor Detail

### DefaultDSCHandler

    public DefaultDSCHandler(OutputStream out)

  Creates a new instance.

  Parameters:
    `out` - OutputStream to pipe all received events to

Method Detail

### startDocument

    public void startDocument(String header)
                       throws IOException

  Description copied from interface: `DSCHandler`
  Called as a new PostScript file starts.

  Specified by:
    `startDocument` in interface `DSCHandler`
  Parameters:
    `header` - the first line of the DSC-compliant file
  Throws:
    `IOException` - In case of an I/O error
  See Also:
    `DSCHandler.startDocument(java.lang.String)`

### endDocument

    public void endDocument()
                     throws IOException

  Description copied from interface: `DSCHandler`
  Called when the PostScript file is fully processed, i.e. after the %%EOF comment.

  Specified by:
    `endDocument` in interface `DSCHandler`
  Throws:
    `IOException` - In case of an I/O error
  See Also:
    `DSCHandler.endDocument()`

### handleDSCComment

    public void handleDSCComment(DSCComment comment)
                          throws IOException

  Description copied from interface: `DSCHandler`
  Called for each standard DSC comment. The classes passed to this method may be simple DSCComment classes or special subclasses for some of the DSC comments.

  Specified by:
    `handleDSCComment` in interface `DSCHandler`
  Parameters:
    `comment` - the DSC comment
  Throws:
    `IOException` - In case of an I/O error
  See Also:
    `DSCHandler.handleDSCComment( org.apache.xmlgraphics.ps.dsc.events.DSCComment)`

### line

    public void line(String line)
              throws IOException

  Description copied from interface: `DSCHandler`
  Called for a normal line of PostScript code.

  Specified by:
    `line` in interface `DSCHandler`
  Parameters:
    `line` - the line of code
  Throws:
    `IOException` - In case of an I/O error
  See Also:
    `DSCHandler.line(java.lang.String)`

### comment

    public void comment(String comment)
                 throws IOException

  Description copied from interface: `DSCHandler`
  Called for any line containing a full-line PostScript comment. This is also called for custom comments following the extension mechanism of the DSC specification.

  Specified by:
    `comment` in interface `DSCHandler`
  Parameters:
    `comment` - the comment line
  Throws:
    `IOException` - In case of an I/O error
  See Also:
    `DSCHandler.comment(java.lang.String)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| xmlgraphics-commons 2.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.