org.enhydra.xml.lazydom.html
Class LazyHTMLElement

java.lang.Object
  |
  +--org.enhydra.apache.xerces.dom.NodeImpl
        |
        +--org.enhydra.apache.xerces.dom.ChildNode
              |
              +--org.enhydra.apache.xerces.dom.ParentNode
                    |
                    +--org.enhydra.apache.xerces.dom.ElementImpl
                          |
                          +--org.enhydra.xml.lazydom.LazyElementNoNS
                                |
                                +--org.enhydra.xml.lazydom.html.LazyHTMLElement
All Implemented Interfaces:
Cloneable, Element, EventTarget, HTMLElement, LazyElement, LazyNode, LazyParent, Node, NodeList, PreFormattedText, Serializable, TypeInfo
Direct Known Subclasses:
HTMLAnchorElementImpl, HTMLAppletElementImpl, HTMLAreaElementImpl, HTMLBaseElementImpl, HTMLBaseFontElementImpl, HTMLBodyElementImpl, HTMLBRElementImpl, HTMLButtonElementImpl, HTMLDirectoryElementImpl, HTMLDivElementImpl, HTMLDListElementImpl, HTMLFieldSetElementImpl, HTMLFontElementImpl, HTMLFormElementImpl, HTMLFrameElementImpl, HTMLFrameSetElementImpl, HTMLHeadElementImpl, HTMLHeadingElementImpl, HTMLHRElementImpl, HTMLHtmlElementImpl, HTMLIFrameElementImpl, HTMLImageElementImpl, HTMLInputElementImpl, HTMLIsIndexElementImpl, HTMLLabelElementImpl, HTMLLegendElementImpl, HTMLLIElementImpl, HTMLLinkElementImpl, HTMLMapElementImpl, HTMLMenuElementImpl, HTMLMetaElementImpl, HTMLModElementImpl, HTMLObjectElementImpl, HTMLOListElementImpl, HTMLOptGroupElementImpl, HTMLOptionElementImpl, HTMLParagraphElementImpl, HTMLParamElementImpl, HTMLPreElementImpl, HTMLQuoteElementImpl, HTMLScriptElementImpl, HTMLSelectElementImpl, HTMLStyleElementImpl, HTMLTableCaptionElementImpl, HTMLTableCellElementImpl, HTMLTableColElementImpl, HTMLTableElementImpl, HTMLTableRowElementImpl, HTMLTableSectionElementImpl, HTMLTextAreaElementImpl, HTMLTitleElementImpl, HTMLUListElementImpl

public class LazyHTMLElement
extends LazyElementNoNS
implements HTMLElement

Implements an HTML-specific element, an Element that will only appear inside HTML documents. This element extends ElementImpl by adding methods for directly manipulating HTML-specific attributes. All HTML elements gain access to the id, title, lang, dir and class attributes. Other elements add their own specific attributes.

Version:
$Revision: 1.5 $ $Date: 2006/12/16 17:01:41 $
Author:
Assaf Arkin
See Also:
HTMLElement, Serialized Form

Inner classes inherited from class org.enhydra.apache.xerces.dom.ParentNode
org.enhydra.apache.xerces.dom.ParentNode.UserDataRecord
 
Fields inherited from class org.enhydra.apache.xerces.dom.ElementImpl
attributes, name, serialVersionUID
 
Fields inherited from class org.enhydra.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.enhydra.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.enhydra.apache.xerces.dom.NodeImpl
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE
 
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from interface org.enhydra.xml.lazydom.LazyNode
DOCUMENT_NODE_ID, NULL_NODE_ID
 
Fields inherited from interface org.w3c.dom.TypeInfo
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION
 
Constructor Summary
(package private) LazyHTMLElement(LazyHTMLDocument owner, LazyElement template, String tagName)
          Constructor required owner document and element tag name.
 
Method Summary
(package private)  String capitalize(String value)
          Convenience method used to capitalize a one-off attribute value before it is returned.
 String getAttribute(String attrName)
           
 Attr getAttributeNode(String attrName)
           
 Attr getAttributeNodeNS(String namespaceURI, String localName)
           
 String getAttributeNS(String namespaceURI, String localName)
           
(package private)  boolean getBinary(String name)
          Convenience method used to translate an attribute value into a boolean value.
(package private)  String getCapitalized(String name)
          Convenience method used to capitalize a one-off attribute value before it is returned.
 String getClassName()
           
 String getDir()
           
 NodeList getElementsByTagName(String tagName)
           
 NodeList getElementsByTagNameNS(String namespaceURI, String localName)
           
 HTMLFormElement getForm()
          Convenience method returns the form in which this form element is contained.
 String getId()
           
(package private)  int getInteger(String value)
          Convenience method used to translate an attribute value into an integer value.
 String getLang()
           
 String getTitle()
           
(package private)  void setAttribute(String name, boolean value)
          Convenience method used to set a boolean attribute.
 void setClassName(String className)
           
 void setDir(String dir)
           
 void setId(String id)
           
 void setLang(String lang)
           
 void setTitle(String title)
           
 
Methods inherited from class org.enhydra.xml.lazydom.LazyElementNoNS
appendChild, appendChildWhileExpanding, areAttributesExpanded, areChildrenExpanded, cloneNode, expandChildren, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeId, getParentNode, getPreFormattedText, getPreviousSibling, getTemplateElement, getTemplateNode, hasChildNodes, insertBefore, isParentExpanded, isTemplateNode, makeTemplateNode, makeTemplateNode, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setChildrenExpanded, setNodeValue, setParentExpanded, setParentWhileExpanding, setPreFormattedText, templateClone
 
Methods inherited from class org.enhydra.apache.xerces.dom.ElementImpl
getBaseURI, getDefaultAttributes, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, getTypeName, getTypeNamespace, getXercesAttribute, hasAttribute, hasAttributeNS, hasAttributes, isDerivedFrom, isEqualNode, moveSpecifiedAttributes, reconcileDefaultAttributes, rename, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setOwnerDocument, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeData
 
Methods inherited from class org.enhydra.apache.xerces.dom.ParentNode
checkNormalizationAfterInsert, checkNormalizationAfterRemove, getChildNodesUnoptimized, getLength, getOwnerDocument, getTextContent, getTextContent, hasTextContent, internalInsertBefore, internalRemoveChild, item, lastChild, lastChild, ownerDocument, setTextContent, synchronizeChildren
 
Methods inherited from class org.enhydra.apache.xerces.dom.ChildNode
parentNode, previousSibling
 
Methods inherited from class org.enhydra.apache.xerces.dom.NodeImpl
addEventListener, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getElementAncestor, getFeature, getLocalName, getNamespaceURI, getNodeNumber, getNodeValue, getPrefix, getReadOnly, getUserData, getUserData, getUserDataRecord, hasStringValue, hasStringValue, internalIsIgnorableWhitespace, isDefaultNamespace, isFirstChild, isFirstChild, isIdAttribute, isIdAttribute, isIgnorableWhitespace, isNormalized, isNormalized, isOwned, isOwned, isReadOnly, isReadOnly, isSameNode, isSpecified, isSpecified, isSupported, lookupNamespacePrefix, lookupNamespaceURI, lookupPrefix, needsSyncChildren, needsSyncChildren, needsSyncData, needsSyncData, removeEventListener, setPrefix, setUserData, setUserData, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.w3c.dom.Element
getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
 

Constructor Detail

LazyHTMLElement

LazyHTMLElement(LazyHTMLDocument owner,
                LazyElement template,
                String tagName)
Constructor required owner document and element tag name. Will be called by the constructor of specific element types but with a known tag name. Assures that the owner document is an HTML element.
Parameters:
owner - The owner HTML document
template - If not null, then this template will be used to initialize the Element.
tagName - The element's tag name
Method Detail

getId

public String getId()
Specified by:
getId in interface HTMLElement

setId

public void setId(String id)
Specified by:
setId in interface HTMLElement

getTitle

public String getTitle()
Specified by:
getTitle in interface HTMLElement

setTitle

public void setTitle(String title)
Specified by:
setTitle in interface HTMLElement

getLang

public String getLang()
Specified by:
getLang in interface HTMLElement

setLang

public void setLang(String lang)
Specified by:
setLang in interface HTMLElement

getDir

public String getDir()
Specified by:
getDir in interface HTMLElement

setDir

public void setDir(String dir)
Specified by:
setDir in interface HTMLElement

getClassName

public String getClassName()
Specified by:
getClassName in interface HTMLElement

setClassName

public void setClassName(String className)
Specified by:
setClassName in interface HTMLElement

getInteger

int getInteger(String value)
Convenience method used to translate an attribute value into an integer value. Returns the integer value or zero if the attribute is not a valid numeric string.
Parameters:
value - The value of the attribute
Returns:
The integer value, or zero if not a valid numeric string

getBinary

boolean getBinary(String name)
Convenience method used to translate an attribute value into a boolean value. If the attribute has an associated value (even an empty string), it is set and true is returned. If the attribute does not exist, false is returend.
Parameters:
value - The value of the attribute
Returns:
True or false depending on whether the attribute has been set

setAttribute

void setAttribute(String name,
                  boolean value)
Convenience method used to set a boolean attribute. If the value is true, the attribute is set to an empty string. If the value is false, the attribute is removed. HTML 4.0 understands empty strings as set attributes.
Parameters:
name - The name of the attribute
value - The value of the attribute

getAttributeNode

public Attr getAttributeNode(String attrName)
Specified by:
getAttributeNode in interface Element
Overrides:
getAttributeNode in class LazyElementNoNS
Following copied from class: org.enhydra.xml.lazydom.LazyElementNoNS
See Also:
Element.getAttributeNode(java.lang.String)

getAttributeNodeNS

public Attr getAttributeNodeNS(String namespaceURI,
                               String localName)
Specified by:
getAttributeNodeNS in interface Element
Overrides:
getAttributeNodeNS in class LazyElementNoNS
Following copied from class: org.enhydra.xml.lazydom.LazyElementNoNS
See Also:
Element.getAttributeNodeNS(java.lang.String, java.lang.String)

getAttribute

public String getAttribute(String attrName)
Specified by:
getAttribute in interface Element
Overrides:
getAttribute in class LazyElementNoNS
Following copied from class: org.enhydra.xml.lazydom.LazyElementNoNS
See Also:
Element.getAttribute(java.lang.String)

getAttributeNS

public String getAttributeNS(String namespaceURI,
                             String localName)
Specified by:
getAttributeNS in interface Element
Overrides:
getAttributeNS in class LazyElementNoNS
Following copied from class: org.enhydra.xml.lazydom.LazyElementNoNS
See Also:
Element.getAttributeNS(java.lang.String, java.lang.String)

getElementsByTagName

public final NodeList getElementsByTagName(String tagName)
Specified by:
getElementsByTagName in interface Element
Overrides:
getElementsByTagName in class org.enhydra.apache.xerces.dom.ElementImpl

getElementsByTagNameNS

public final NodeList getElementsByTagNameNS(String namespaceURI,
                                             String localName)
Specified by:
getElementsByTagNameNS in interface Element
Overrides:
getElementsByTagNameNS in class org.enhydra.apache.xerces.dom.ElementImpl

capitalize

String capitalize(String value)
Convenience method used to capitalize a one-off attribute value before it is returned. For example, the align values "LEFT" and "left" will both return as "Left".
Parameters:
value - The value of the attribute
Returns:
The capitalized value

getCapitalized

String getCapitalized(String name)
Convenience method used to capitalize a one-off attribute value before it is returned. For example, the align values "LEFT" and "left" will both return as "Left".
Parameters:
name - The name of the attribute
Returns:
The capitalized value

getForm

public HTMLFormElement getForm()
Convenience method returns the form in which this form element is contained. This method is exposed for form elements through the DOM API, but other elements have no access to it through the API.


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.