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> 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 | 1 /* 2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. 3 */ 4 /* 5 * Licensed to the Apache Software Foundation (ASF) under one or more 6 * contributor license agreements. See the NOTICE file distributed with 7 * this work for additional information regarding copyright ownership. 8 * The ASF licenses this file to You under the Apache License, Version 2.0 9 * (the "License"); you may not use this file except in compliance with 10 * the License. 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> 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 76 77 /** 78 * Stops the parsing process. 79 * @return true if the parsing process can be stopped, false otherwise 80 */ 81 public boolean stop(); 82 83 /** 84 * Resumes the parsing process that has been stopped by the {@link #stop()} 85 * method. The method will simply return if parsing is not stopped. 86 * @return true if the parsing process is resumed successfully, false 87 * otherwise 88 */ 89 public boolean resume(); 90 91 } // interface XMLDocumentScanner |