1 19 20 33 package org.htmlparser.scanners; 34 35 import org.htmlparser.tags.Tag; 36 import org.htmlparser.tags.TitleTag; 37 import org.htmlparser.tags.data.CompositeTagData; 38 import org.htmlparser.tags.data.TagData; 39 40 43 public class TitleScanner extends CompositeTagScanner 44 { 45 private static final String MATCH_NAME[] = { "TITLE" }; 46 47 public TitleScanner(String filter) 48 { 49 super(filter, MATCH_NAME); 50 } 51 52 public String [] getID() 53 { 54 return MATCH_NAME; 55 } 56 57 public boolean evaluate( 58 String tagNameBeingChecked, 59 TagScanner previousOpenScanner) 60 { 61 absorbLeadingBlanks(tagNameBeingChecked); 62 return ( 63 tagNameBeingChecked.toUpperCase().startsWith(MATCH_NAME[0]) 64 && null == previousOpenScanner); 65 } 66 67 public Tag createTag(TagData tagData, CompositeTagData compositeTagData) 68 { 69 return new TitleTag(tagData, compositeTagData); 70 } 71 72 } 73 | Popular Tags |