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