1 19 20 33 package org.htmlparser.scanners; 34 35 36 import org.htmlparser.Node; 37 import org.htmlparser.tags.OptionTag; 38 import org.htmlparser.tags.SelectTag; 39 import org.htmlparser.tags.Tag; 40 import org.htmlparser.tags.data.CompositeTagData; 41 import org.htmlparser.tags.data.TagData; 42 import org.htmlparser.util.NodeList; 43 44 45 public class SelectTagScanner extends CompositeTagScanner 46 { 47 private static final String MATCH_NAME[] = { "SELECT" }; 48 private NodeList optionTags; 49 50 public SelectTagScanner() 51 { 52 super(MATCH_NAME); 53 } 54 55 public SelectTagScanner(String filter) 56 { 57 super(filter, MATCH_NAME); 58 } 59 60 public String [] getID() 61 { 62 return MATCH_NAME; 63 } 64 65 public Tag createTag(TagData tagData, CompositeTagData compositeTagData) 66 { 67 return new SelectTag(tagData, compositeTagData, optionTags); 68 } 69 70 public void childNodeEncountered(Node node) 71 { 72 if (node instanceof OptionTag) 73 optionTags.add(node); 74 } 75 76 public void beforeScanningStarts() 77 { 78 optionTags = new NodeList(); 79 } 80 81 } 82 | Popular Tags |