01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /* $Id$ */
19:
20: package org.apache.xmlgraphics.ps.dsc;
21:
22: import java.io.IOException;
23:
24: import org.apache.xmlgraphics.ps.dsc.events.DSCEvent;
25:
26: /**
27: * Interface that is used to delegate the handling of nested documents (EPS files, data sections)
28: * in a PostScript document. The implementation receives a parser instance so it can step forward
29: * until the end of the nested document is reached at which point control is given back to the
30: * original consumer.
31: */
32: public interface NestedDocumentHandler {
33:
34: /**
35: * Handle a DSC event. Implementations may issue additional calls to the DSC parser and may
36: * modify its state. When returning from the call, state information such as filters should
37: * be restored.
38: * @param event the DSC event to handle
39: * @param parser the DSC parser to work with
40: * @throws IOException In case of an I/O error
41: * @throws DSCException In case of a violation of the DSC spec
42: */
43: void handle(DSCEvent event, DSCParser parser) throws IOException,
44: DSCException;
45:
46: }
|