1 27 package org.htmlparser.tags; 28 29 import org.htmlparser.lexer.Page; 30 import org.htmlparser.nodes.TagNode; 31 import org.htmlparser.util.ParserException; 32 33 37 public class BaseHrefTag 38 extends 39 TagNode 40 { 41 44 private static final String [] mIds = new String [] {"BASE"}; 45 46 49 public BaseHrefTag () 50 { 51 } 52 53 57 public String [] getIds () 58 { 59 return (mIds); 60 } 61 62 66 public String getBaseUrl() 67 { 68 String base; 69 70 base = getAttribute ("HREF"); 71 if (base != null && base.length() > 0) 72 base = base.trim (); 73 base = (null == base) ? "" : base; 74 75 return (base); 76 } 77 78 public void setBaseUrl (String base) 79 { 80 setAttribute ("HREF", base); 81 } 82 83 87 public void doSemanticAction () throws ParserException 88 { 89 Page page; 90 91 page = getPage (); 92 if (null != page) 93 { 94 page.setBaseUrl (getBaseUrl ()); 95 } 96 } 97 } 98 | Popular Tags |