Class DefaultNestedDocumentHandler

    • Constructor Detail

      • DefaultNestedDocumentHandler

        public DefaultNestedDocumentHandler​(PSGenerator gen)
        Creates a new instance.
        Parameters:
        gen - PSGenerator to pass through the skipped content
    • Method Detail

      • handle

        public void handle​(DSCEvent event,
                           DSCParser parser)
                    throws java.io.IOException,
                           DSCException
        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 interface NestedDocumentHandler
        Parameters:
        event - the DSC event to handle
        parser - the DSC parser to work with
        Throws:
        java.io.IOException - In case of an I/O error
        DSCException - In case of a violation of the DSC spec
      • 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