KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xerces > xni > parser > XMLDTDScanner


1 /*
2  * Copyright 2001, 2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.xerces.xni.parser;
18
19 import java.io.IOException JavaDoc;
20 import org.apache.xerces.xni.XNIException;
21
22 /**
23  * This interface defines a generic DTD scanner. This interface
24  * allows a scanner to be used interchangably in existing parser
25  * configurations.
26  * <p>
27  * If the parser configuration uses a DTD scanner that implements
28  * this interface, components should be able to query the scanner
29  * instance from the component manager using the following property
30  * identifier:
31  * <blockquote>
32  * "http://apache.org/xml/properties/internal/dtd-scanner"
33  * </blockquote>
34  *
35  * @author Andy Clark, IBM
36  *
37  * @version $Id: XMLDTDScanner.java,v 1.7 2004/10/03 21:58:18 mrglavas Exp $
38  */

39 public interface XMLDTDScanner
40     extends XMLDTDSource, XMLDTDContentModelSource {
41
42     //
43
// XMLDTDScanner methods
44
//
45

46     /**
47      * Sets the input source.
48      *
49      * @param inputSource The input source or null.
50      *
51      * @throws IOException Thrown on i/o error.
52      */

53     public void setInputSource(XMLInputSource inputSource) throws IOException JavaDoc;
54
55     /**
56      * Scans the internal subset of the document.
57      *
58      * @param complete True if the scanner should scan the document
59      * completely, pushing all events to the registered
60      * document handler. A value of false indicates that
61      * that the scanner should only scan the next portion
62      * of the document and return. A scanner instance is
63      * permitted to completely scan a document if it does
64      * not support this "pull" scanning model.
65      * @param standalone True if the document was specified as standalone.
66      * This value is important for verifying certain
67      * well-formedness constraints.
68      * @param hasExternalSubset True if the document has an external DTD.
69      * This allows the scanner to properly notify
70      * the handler of the end of the DTD in the
71      * absence of an external subset.
72      *
73      * @return True if there is more to scan, false otherwise.
74      */

75     public boolean scanDTDInternalSubset(boolean complete, boolean standalone,
76                                          boolean hasExternalSubset)
77         throws IOException JavaDoc, XNIException;
78
79     /**
80      * Scans the external subset of the document.
81      *
82      * @param complete True if the scanner should scan the document
83      * completely, pushing all events to the registered
84      * document handler. A value of false indicates that
85      * that the scanner should only scan the next portion
86      * of the document and return. A scanner instance is
87      * permitted to completely scan a document if it does
88      * not support this "pull" scanning model.
89      *
90      * @return True if there is more to scan, false otherwise.
91      */

92     public boolean scanDTDExternalSubset(boolean complete)
93         throws IOException JavaDoc, XNIException;
94
95 } // interface XMLDTDScanner
96
Popular Tags