1 19 20 33 package org.htmlparser.scanners; 34 35 import org.htmlparser.Parser; 36 import org.htmlparser.tags.TableRow; 37 import org.htmlparser.tags.TableTag; 38 import org.htmlparser.tags.Tag; 39 import org.htmlparser.tags.data.CompositeTagData; 40 import org.htmlparser.tags.data.TagData; 41 import org.htmlparser.util.NodeList; 42 43 public class TableScanner extends CompositeTagScanner 44 { 45 private final static String MATCH_STRING[] = { "TABLE" }; 46 private final static String ENDERS[] = { "BODY", "HTML" }; 47 private final static String ENDTAG_ENDERS[] = { "BODY", "HTML" }; 48 49 public TableScanner(Parser parser) 50 { 51 this(parser, ""); 52 } 53 54 public TableScanner(Parser parser, String filter) 55 { 56 super(filter, MATCH_STRING, ENDERS, ENDTAG_ENDERS, true); 57 parser.addScanner(new TableRowScanner(parser)); 58 59 } 60 61 public Tag createTag(TagData tagData, CompositeTagData compositeTagData) 62 { 63 NodeList rows = 64 compositeTagData.getChildren().searchFor(TableRow.class); 65 return new TableTag(tagData, compositeTagData, rows); 66 } 67 68 public String [] getID() 69 { 70 return MATCH_STRING; 71 } 72 73 } 74 | Popular Tags |