/*
************************************
* XMLC GENERATED CODE, DO NOT EDIT *
************************************
*/
import org.w3c.dom.*;
import org.enhydra.xml.xmlc.XMLCUtil;
import org.enhydra.xml.xmlc.XMLCError;
import org.enhydra.xml.xmlc.dom.XMLCDomFactory;
public class Hello extends org.enhydra.xml.xmlc.html.HTMLObjectImpl {
/**
* Field that is used to identify this as an XMLC
* generated class. Contains an reference to the
* class object.
*/
public static final Class XMLC_GENERATED_CLASS = Hello.class;
/**
* Field containing CLASSPATH relative name of the source file
* that this class was generated from.
*/
public static final String XMLC_SOURCE_FILE = "nullhello.html";
/**
* Get the element with id Greeting
.
* @see org.w3c.dom.html.HTMLElement
*/
public org.w3c.dom.html.HTMLElement getElementGreeting() {
return $elementGreeting;
}
private org.w3c.dom.html.HTMLElement $elementGreeting;
/**
* Get the value of text child of element Greeting
.
* @see org.w3c.dom.Text
*/
public void setTextGreeting(String text) {
XMLCUtil.getFirstText($elementGreeting).setData(text);
}
/**
* Get the element with id Messages
.
* @see org.w3c.dom.html.HTMLElement
*/
public org.w3c.dom.html.HTMLElement getElementMessages() {
return $elementMessages;
}
private org.w3c.dom.html.HTMLElement $elementMessages;
/**
* Get the value of text child of element Messages
.
* @see org.w3c.dom.Text
*/
public void setTextMessages(String text) {
XMLCUtil.getFirstText($elementMessages).setData(text);
}
/**
* Create document object.
*/
private static Document createDocument() {
XMLCDomFactory domFactory = new org.enhydra.xml.xmlc.dom.DefaultHTMLDomFactory();
Document document = domFactory.createDocument(null, null);
return document;
}
/**
* Create document as a DOM and initialize accessor method fields.
*/
public void buildDocument() {
Document document = createDocument();
setDocument(document);
Node $node0, $node1, $node2, $node3, $node4;
Element $elem0, $elem1, $elem2, $elem3;
Attr $attr0, $attr1, $attr2, $attr3;
$elem0 = document.getDocumentElement();
$elem1 = document.createElement("HEAD");;
$elem0.appendChild($elem1);
$elem2 = document.createElement("TITLE");;
$elem1.appendChild($elem2);
$node3 = document.createTextNode("Hello");;
$elem2.appendChild($node3);
$elem1 = document.createElement("BODY");;
$elem0.appendChild($elem1);
$elem2 = document.createElement("H2");;
$elem1.appendChild($elem2);
$elem3 = document.createElement("SPAN");;
$elem2.appendChild($elem3);
$elementGreeting = (org.w3c.dom.html.HTMLElement)$elem3;
$attr3 = document.createAttribute("id");
$attr3.setValue("Greeting");
$elem3.setAttributeNode($attr3);
$node4 = document.createTextNode("Hello, Kathlyn");;
$elem3.appendChild($node4);
$node2 = document.createTextNode("You have ");;
$elem1.appendChild($node2);
$elem2 = document.createElement("SPAN");;
$elem1.appendChild($elem2);
$elementMessages = (org.w3c.dom.html.HTMLElement)$elem2;
$attr2 = document.createAttribute("id");
$attr2.setValue("Messages");
$elem2.setAttributeNode($attr2);
$node3 = document.createTextNode("103");;
$elem2.appendChild($node3);
$node2 = document.createTextNode(" new messages.");;
$elem1.appendChild($node2);
$node1 = document.createComment(" hello.html ");;
$elem0.appendChild($node1);
}
/**
* Recursize function to do set access method fields from the DOM.
* Missing ids have fields set to null.
*/
protected void syncWithDocument(Node node) {
if (node instanceof Element) {
String id = ((Element)node).getAttribute("id");
if (id.length() == 0) {
} else if (id.equals("Greeting")) {
$elementGreeting = (org.w3c.dom.html.HTMLElement)node;
} else if (id.equals("Messages")) {
$elementMessages = (org.w3c.dom.html.HTMLElement)node;
}
}
}
/**
* Default constructor.
*/
public Hello() {
buildDocument();
}
/**
* Constructor with optional building of the DOM.
*
* @param buildDOM If false, the DOM will not be built until
* buildDocument() is called by the derived class. If true,
* the DOM is built immediatly.
*/
public Hello(boolean buildDOM) {
if (buildDOM) {
buildDocument();
}
}
/**
* Copy constructor.
* @param src The document to clone.
*/
public Hello(Hello src) {
setDocument((Document)src.getDocument().cloneNode(true));
syncAccessMethods();
}
/**
* Clone the document.
* @param deep Must be true, only deep clone is supported.
*/
public Node cloneNode(boolean deep) {
cloneDeepCheck(deep);
return new Hello(this);
}
}