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 DTD 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 DTD 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/dtd-scanner"
34: * </blockquote>
35: *
36: * @author Andy Clark, IBM
37: *
38: * @version $Id: XMLDTDScanner.java 447244 2006-09-18 05:20:40Z mrglavas $
39: */
40: public interface XMLDTDScanner extends XMLDTDSource,
41: XMLDTDContentModelSource {
42:
43: //
44: // XMLDTDScanner methods
45: //
46:
47: /**
48: * Sets the input source.
49: *
50: * @param inputSource The input source or null.
51: *
52: * @throws IOException Thrown on i/o error.
53: */
54: public void setInputSource(XMLInputSource inputSource)
55: throws IOException;
56:
57: /**
58: * Scans the internal subset of the document.
59: *
60: * @param complete True if the scanner should scan the document
61: * completely, pushing all events to the registered
62: * document handler. A value of false indicates that
63: * that the scanner should only scan the next portion
64: * of the document and return. A scanner instance is
65: * permitted to completely scan a document if it does
66: * not support this "pull" scanning model.
67: * @param standalone True if the document was specified as standalone.
68: * This value is important for verifying certain
69: * well-formedness constraints.
70: * @param hasExternalSubset True if the document has an external DTD.
71: * This allows the scanner to properly notify
72: * the handler of the end of the DTD in the
73: * absence of an external subset.
74: *
75: * @return True if there is more to scan, false otherwise.
76: */
77: public boolean scanDTDInternalSubset(boolean complete,
78: boolean standalone, boolean hasExternalSubset)
79: throws IOException, XNIException;
80:
81: /**
82: * Scans the external subset of the document.
83: *
84: * @param complete True if the scanner should scan the document
85: * completely, pushing all events to the registered
86: * document handler. A value of false indicates that
87: * that the scanner should only scan the next portion
88: * of the document and return. A scanner instance is
89: * permitted to completely scan a document if it does
90: * not support this "pull" scanning model.
91: *
92: * @return True if there is more to scan, false otherwise.
93: */
94: public boolean scanDTDExternalSubset(boolean complete)
95: throws IOException, XNIException;
96:
97: } // interface XMLDTDScanner
|