
org.enhydra.xml.xmlc.dom.generic.GenericLinkedHTMLDocument Maven / Gradle / Ivy
The newest version!
package org.enhydra.xml.xmlc.dom.generic;
import org.enhydra.xml.xmlc.XMLObjectLink;
import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.html.HTMLCollection;
import org.w3c.dom.html.HTMLDocument;
import org.w3c.dom.html.HTMLElement;
/**
* This is a generic wrapper around {@link HTMLDocument} that adds {@link
* XMLObjectLink} functionality.
*/
public class GenericLinkedHTMLDocument extends GenericLinkedDocument
implements HTMLDocument {
/**
* Constructor.
* @param inner the document to be wrapped.
*/
public GenericLinkedHTMLDocument(HTMLDocument inner) {
super(inner);
}
/** @see Node#cloneNode */
public Node cloneNode(boolean deep) {
// Make sure the cloned document is an object link as well,
// and points back to the same object...
GenericLinkedHTMLDocument clone =
new GenericLinkedHTMLDocument(
(HTMLDocument)DELEGATE.cloneNode(deep));
clone.setXMLObject(getXMLObject());
return clone;
}
// Everything below here simply passes all calls through to the
// wrapped object...
public String getTitle() {
return ((HTMLDocument)DELEGATE).getTitle();
}
public void setTitle(String title) {
((HTMLDocument)DELEGATE).setTitle(title);
}
public String getReferrer() {
return ((HTMLDocument)DELEGATE).getReferrer();
}
public String getDomain() {
return ((HTMLDocument)DELEGATE).getDomain();
}
public String getURL() {
return ((HTMLDocument)DELEGATE).getURL();
}
public HTMLElement getBody() {
return ((HTMLDocument)DELEGATE).getBody();
}
public void setBody(HTMLElement body) {
((HTMLDocument)DELEGATE).setBody(body);
}
public HTMLCollection getImages() {
return ((HTMLDocument)DELEGATE).getImages();
}
public HTMLCollection getApplets() {
return ((HTMLDocument)DELEGATE).getApplets();
}
public HTMLCollection getLinks() {
return ((HTMLDocument)DELEGATE).getLinks();
}
public HTMLCollection getForms() {
return ((HTMLDocument)DELEGATE).getForms();
}
public HTMLCollection getAnchors() {
return ((HTMLDocument)DELEGATE).getAnchors();
}
public String getCookie() {
return ((HTMLDocument)DELEGATE).getCookie();
}
public void setCookie(String cookie) throws DOMException {
((HTMLDocument)DELEGATE).setCookie(cookie);
}
public void open() {
((HTMLDocument)DELEGATE).open();
}
public void close() {
((HTMLDocument)DELEGATE).close();
}
public void write(String text) {
((HTMLDocument)DELEGATE).write(text);
}
public void writeln(String text) {
((HTMLDocument)DELEGATE).writeln(text);
}
public NodeList getElementsByName(String elementName) {
return ((HTMLDocument)DELEGATE).getElementsByName(elementName);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy