1 38 package com.gargoylesoftware.htmlunit.html; 39 40 import java.util.Map ; 41 42 43 52 public class HtmlTitle extends HtmlElement { 53 54 55 public static final String TAG_NAME = "title"; 56 57 63 public HtmlTitle( final HtmlPage page, final Map attributes ) { 64 super(page, attributes); 65 } 66 67 70 public String getTagName() { 71 return TAG_NAME; 72 } 73 74 75 80 public void setNodeValue(final String message) { 81 final DomNode child = getFirstChild(); 82 if (child == null) { 83 final DomNode textNode = new DomText(getPage() , message); 84 appendChild(textNode); 85 } 86 else if (child instanceof DomText) { 87 ((DomText) child).setData(message); 88 } 89 else { 90 throw new IllegalStateException ("For title tag, this should be a text node"); 91 } 92 } 93 94 } 95 | Popular Tags |