1 // This file is part of TagSoup and is Copyright 2002-2008 by John Cowan. 2 // 3 // TagSoup is licensed under the Apache License, 4 // Version 2.0. You may obtain a copy of this license at 5 // http://www.apache.org/licenses/LICENSE-2.0 . You may also have 6 // additional legal rights not granted by this license. 7 // 8 // TagSoup is distributed in the hope that it will be useful, but 9 // unless required by applicable law or agreed to in writing, TagSoup 10 // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 11 // OF ANY KIND, either express or implied; not even the implied warranty 12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 // 14 // 15 // Scanner 16 17 package org.ccil.cowan.tagsoup; 18 import java.io.IOException; 19 import java.io.Reader; 20 import org.xml.sax.SAXException; 21 22 /** 23 An interface allowing Parser to invoke scanners. 24 **/ 25 26 public interface Scanner { 27 28 /** 29 Invoke a scanner. 30 @param r A source of characters to scan 31 @param h A ScanHandler to report events to 32 **/ 33 34 public void scan(Reader r, ScanHandler h) throws IOException, SAXException; 35 36 /** 37 Reset the embedded locator. 38 @param publicid The publicid of the source 39 @param systemid The systemid of the source 40 **/ 41 42 public void resetDocumentLocator(String publicid, String systemid); 43 44 /** 45 Signal to the scanner to start CDATA content mode. 46 **/ 47 48 public void startCDATA(); 49 50 } 51