1 27 28 package org.objectweb.clif.protocol.http.lib; 29 30 import org.htmlparser.HTMLReader; 31 import org.htmlparser.scanners.HTMLTagScanner; 32 import org.htmlparser.tags.HTMLTag; 33 import org.htmlparser.util.HTMLParserException; 34 35 38 public class HtmlGenericScanner extends HTMLTagScanner { 39 40 private String tagString; 41 42 public HtmlGenericScanner(String filter, String tag) { 43 super(filter); 44 tagString = tag; 45 } 46 47 public HTMLTag scan(HTMLTag tag, String url, HTMLReader reader, String currLine) 48 throws HTMLParserException { 49 50 try { 51 HtmlGenericTag genericTag = 52 new HtmlGenericTag( 53 tag.elementBegin(), 54 tag.elementEnd(), 55 tag.getText(), 56 currLine, 57 tagString); 58 return genericTag; 59 } catch (Exception e) { 60 throw new HTMLParserException( 61 "HtmlGenericScanner.scan(): Error while scanning generic tags, current line = " 62 + currLine, 63 e); 64 } 65 66 } 67 68 public String [] getID() { 69 String [] ids = new String [1]; 70 ids[0] = tagString; 71 return ids; 72 } 73 74 } 75 | Popular Tags |