FilteringEventListener
Date: 2016-04-28

org.apache.xmlgraphics.ps.dsc

## Class FilteringEventListener

- java.lang.Object
- - org.apache.xmlgraphics.ps.dsc.FilteringEventListener

- All Implemented Interfaces:
    DSCListener

      public class FilteringEventListener
      extends java.lang.Object
      implements DSCListener

  `DSCListener` implementation that filters certain DSC events.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilteringEventListener(DSCFilter filter)` Main constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `processEvent(DSCEvent event, DSCParser parser)` Called for each DSC event.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FilteringEventListener

          public FilteringEventListener(DSCFilter filter)

      Main constructor.
      Parameters:
        `filter` - the filter

  - ### Method Detail

    - #### processEvent

          public void processEvent(DSCEvent event,
                          DSCParser parser)
                            throws java.io.IOException,
                                   DSCException

      Called for each DSC event. You can call methods on the DSC parser to skip comments, for example. But implementations need to be good citizens and take into account that multiple listeners can be active at the same time and that they might interfere with other listeners. When returning from the call, state information such as filters should be restored.
      Specified by:
        `processEvent` in interface `DSCListener`
      Parameters:
        `event` - the DSC event
        `parser` - the DSC parser
      Throws:
        `java.io.IOException` - if an I/O error occurs
        `DSCException` - if a DSC-specific error occurs