1 19 20 33 package org.htmlparser.scanners; 34 35 import org.htmlparser.Parser; 36 import org.htmlparser.tags.TableColumn; 37 import org.htmlparser.tags.TableRow; 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 TableRowScanner extends CompositeTagScanner 44 { 45 private final static String MATCH_STRING[] = { "TR" }; 46 47 public TableRowScanner(Parser parser) 48 { 49 this("", parser); 50 } 51 52 public TableRowScanner(String filter, Parser parser) 53 { 54 this(filter, parser, MATCH_STRING, new String [] { 55 }, new String [] { 56 }, false); 57 } 58 59 public TableRowScanner( 60 String filter, 61 Parser parser, 62 String [] nameOfTagToMatch, 63 String [] tagEnders, 64 String [] endTagEnders, 65 boolean allowSelfChildren) 66 { 67 super( 68 filter, 69 nameOfTagToMatch, 70 tagEnders, 71 endTagEnders, 72 allowSelfChildren); 73 parser.addScanner(new TableColumnScanner()); 74 } 75 76 public Tag createTag(TagData tagData, CompositeTagData compositeTagData) 77 { 78 NodeList columns = 79 compositeTagData.getChildren().searchFor(TableColumn.class); 80 return new TableRow(tagData, compositeTagData, columns); 81 } 82 83 public String [] getID() 84 { 85 return MATCH_STRING; 86 } 87 88 } 89 | Popular Tags |