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: package org.apache.xerces.xni.parser;
19:
20: import java.io.IOException;
21: import org.apache.xerces.xni.XNIException;
22:
23: /**
24: * This interface defines a generic document scanner. This interface
25: * allows a scanner to be used interchangably in existing parser
26: * configurations.
27: * <p>
28: * If the parser configuration uses a document scanner that implements
29: * this interface, components should be able to query the scanner
30: * instance from the component manager using the following property
31: * identifier:
32: * <blockquote>
33: * "http://apache.org/xml/properties/internal/document-scanner"
34: * </blockquote>
35: *
36: * @author Andy Clark, IBM
37: *
38: * @version $Id: XMLDocumentScanner.java 447244 2006-09-18 05:20:40Z mrglavas $
39: */
40: public interface XMLDocumentScanner extends XMLDocumentSource {
41:
42: //
43: // XMLDocumentScanner methods
44: //
45:
46: /**
47: * Sets the input source.
48: *
49: * @param inputSource The input source.
50: *
51: * @throws IOException Thrown on i/o error.
52: */
53: public void setInputSource(XMLInputSource inputSource)
54: throws IOException;
55:
56: /**
57: * Scans a document.
58: *
59: * @param complete True if the scanner should scan the document
60: * completely, pushing all events to the registered
61: * document handler. A value of false indicates that
62: * that the scanner should only scan the next portion
63: * of the document and return. A scanner instance is
64: * permitted to completely scan a document if it does
65: * not support this "pull" scanning model.
66: *
67: * @return True if there is more to scan, false otherwise.
68: */
69: public boolean scanDocument(boolean complete) throws IOException,
70: XNIException;
71:
72: } // interface XMLDocumentScanner
|