1/*
2 * reserved comment block
3 * DO NOT REMOVE OR ALTER!
4 */
5/*
6 * Licensed to the Apache Software Foundation (ASF) under one or more
7 * contributor license agreements.  See the NOTICE file distributed with
8 * this work for additional information regarding copyright ownership.
9 * The ASF licenses this file to You under the Apache License, Version 2.0
10 * (the "License"); you may not use this file except in compliance with
11 * the License.  You may obtain a copy of the License at
12 *
13 *      http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 */
21
22package com.sun.org.apache.xerces.internal.xni.parser;
23
24import java.io.IOException;
25import com.sun.org.apache.xerces.internal.xni.XNIException;
26
27/**
28 * This interface defines a generic document scanner. This interface
29 * allows a scanner to be used interchangably in existing parser
30 * configurations.
31 * <p>
32 * If the parser configuration uses a document scanner that implements
33 * this interface, components should be able to query the scanner
34 * instance from the component manager using the following property
35 * identifier:
36 * <blockquote>
37 *  "http://apache.org/xml/properties/internal/document-scanner"
38 * </blockquote>
39 *
40 * @author Andy Clark, IBM
41 *
42 */
43public interface XMLDocumentScanner
44    extends XMLDocumentSource {
45
46    //
47    // XMLDocumentScanner methods
48    //
49
50    /**
51     * Sets the input source.
52     *
53     * @param inputSource The input source.
54     *
55     * @throws IOException Thrown on i/o error.
56     */
57    public void setInputSource(XMLInputSource inputSource) throws IOException;
58
59    /**
60     * Scans a document.
61     *
62     * @param complete True if the scanner should scan the document
63     *                 completely, pushing all events to the registered
64     *                 document handler. A value of false indicates that
65     *                 that the scanner should only scan the next portion
66     *                 of the document and return. A scanner instance is
67     *                 permitted to completely scan a document if it does
68     *                 not support this "pull" scanning model.
69     *
70     * @return True if there is more to scan, false otherwise.
71     */
72    public boolean scanDocument(boolean complete)
73        throws IOException, XNIException;
74
75    public int next() throws XNIException, IOException;
76} // interface XMLDocumentScanner
77