
org.enhydra.xml.xhtml.dom.xerces.XHTMLScriptElementImpl Maven / Gradle / Ivy
The newest version!
/*
* Enhydra Java Application Server Project
*
* The contents of this file are subject to the Enhydra Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License on
* the Enhydra web site ( http://www.enhydra.org/ ).
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific terms governing rights and limitations
* under the License.
*
* The Initial Developer of the Original Code is DigitalSesame
* Portions created by DigitalSesame are Copyright (C) 1997-2000 DigitalSesame
* All Rights Reserved.
*
* Contributor(s):
* Rex Tsai
* David Li
*
* $Id: XHTMLScriptElementImpl.java,v 1.2 2005/01/26 08:29:24 jkjome Exp $
*/
package org.enhydra.xml.xhtml.dom.xerces;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
public class XHTMLScriptElementImpl
extends XHTMLElementImpl
implements org.enhydra.xml.xhtml.dom.XHTMLScriptElement
{
public XHTMLScriptElementImpl (XHTMLDocumentBase owner, String namespaceURI, String tagName) {
super( owner, namespaceURI, tagName);
}
public void setId (String newValue) {
setAttribute("id", newValue);
}
public String getId () {
return getAttribute ("id");
}
public void setLang (String newValue) {
setAttribute("lang", newValue);
}
public String getLang () {
return getAttribute ("lang");
}
public void setDir (String newValue) {
setAttribute("dir", newValue);
}
public String getDir () {
return getAttribute ("dir");
}
public void setClassName (String newValue) {
setAttribute("class", newValue);
}
public String getClassName () {
return getAttribute ("class");
}
public void setTitle (String newValue) {
setAttribute("title", newValue);
}
public String getTitle () {
return getAttribute ("title");
}
public void setType (String newValue) {
setAttribute("type", newValue);
}
public String getType () {
return getAttribute ("type");
}
public void setCharset (String newValue) {
setAttribute("charset", newValue);
}
public String getCharset () {
return getAttribute ("charset");
}
public void setSrc (String newValue) {
setAttribute("src", newValue);
}
public String getSrc () {
return getAttribute ("src");
}
public void setHtmlFor (String newValue) {
setAttribute("htmlfor", newValue);
}
public String getHtmlFor () {
return getAttribute ("htmlfor");
}
public void setEvent (String newValue) {
setAttribute("event", newValue);
}
public String getEvent () {
return getAttribute ("event");
}
public void setDefer (boolean newValue) {
setAttribute("defer", newValue);
}
public boolean getDefer () {
return getBooleanAttribute("defer");
}
public void setLanguage (String newValue) {
setAttribute("language", newValue);
}
public String getLanguage () {
return getAttribute ("language");
}
public String getText() {
Node child;
String text;
// Find the Text nodes contained within this element and return their
// concatenated value. Required to go around comments, entities, etc.
child = getFirstChild();
text = "";
while ( child != null )
{
if ( child instanceof Text )
text = text + ( (Text) child ).getData();
child = child.getNextSibling();
}
return text;
}
public void setText( String text ) {
Node child;
Node next;
// Delete all the nodes and replace them with a single Text node.
// This is the only approach that can handle comments and other nodes.
child = getFirstChild();
while ( child != null )
{
next = child.getNextSibling();
removeChild( child );
child = next;
}
insertBefore( getOwnerDocument().createTextNode( text ), getFirstChild() );
}
;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy