Package org.apache.xmlgraphics.ps.dsc
Class DefaultNestedDocumentHandler
java.lang.Object
org.apache.xmlgraphics.ps.dsc.DefaultNestedDocumentHandler
- All Implemented Interfaces:
DSCListener
,DSCParserConstants
,NestedDocumentHandler
public class DefaultNestedDocumentHandler
extends Object
implements DSCParserConstants, NestedDocumentHandler, DSCListener
DSCListener
implementation which automatically skips data
between Begin/EndDocument and Begin/EndData.-
Field Summary
Fields inherited from interface org.apache.xmlgraphics.ps.dsc.DSCParserConstants
COMMENT, DSC_COMMENT, EOF, HEADER_COMMENT, LINE
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DefaultNestedDocumentHandler
Creates a new instance.- Parameters:
gen
- PSGenerator to pass through the skipped content
-
-
Method Details
-
handle
Handle a DSC event. Implementations may issue additional calls to the DSC parser and may modify its state. When returning from the call, state information such as filters should be restored.- Specified by:
handle
in interfaceNestedDocumentHandler
- Parameters:
event
- the DSC event to handleparser
- the DSC parser to work with- Throws:
IOException
- In case of an I/O errorDSCException
- In case of a violation of the DSC spec
-
processEvent
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 interfaceDSCListener
- Parameters:
event
- the DSC eventparser
- the DSC parser- Throws:
IOException
- if an I/O error occursDSCException
- if a DSC-specific error occurs
-