Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.xml.lazydom.html
Class LazyHTMLElement  view LazyHTMLElement download LazyHTMLElement.java

java.lang.Object
  extended byorg.apache.xerces.dom.NodeImpl
      extended byorg.apache.xerces.dom.ChildNode
          extended byorg.apache.xerces.dom.ParentNode
              extended byorg.apache.xerces.dom.ElementImpl
                  extended byorg.enhydra.xml.lazydom.LazyElementNoNS
                      extended byorg.enhydra.xml.lazydom.html.LazyHTMLElement
All Implemented Interfaces:
java.lang.Cloneable, org.w3c.dom.Element, org.w3c.dom.events.EventTarget, org.w3c.dom.html.HTMLElement, org.enhydra.xml.lazydom.LazyElement, org.enhydra.xml.lazydom.LazyNode, org.enhydra.xml.lazydom.LazyParent, org.w3c.dom.Node, org.w3c.dom.NodeList, org.enhydra.xml.io.PreFormattedText, java.io.Serializable, org.apache.xerces.dom3.TypeInfo

public class LazyHTMLElement
extends org.enhydra.xml.lazydom.LazyElementNoNS
implements org.w3c.dom.html.HTMLElement

Implements an HTML-specific element, an org.w3c.dom.Element that will only appear inside HTML documents. This element extends org.apache.xerces.dom.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$ $Date$

Field Summary
 
Fields inherited from class org.enhydra.xml.lazydom.LazyElementNoNS
 
Fields inherited from class org.apache.xerces.dom.ElementImpl
attributes, name
 
Fields inherited from class org.apache.xerces.dom.ParentNode
firstChild, fNodeListCache, ownerDocument
 
Fields inherited from class org.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.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_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.apache.xerces.dom3.TypeInfo
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION
 
Constructor Summary
(package private) LazyHTMLElement(LazyHTMLDocument owner, org.enhydra.xml.lazydom.LazyElement template, java.lang.String tagName)
          Constructor required owner document and element tag name.
 
Method Summary
(package private)  java.lang.String capitalize(java.lang.String value)
          Convenience method used to capitalize a one-off attribute value before it is returned.
 java.lang.String getAttribute(java.lang.String attrName)
          Retrieves an attribute value by name.
 org.w3c.dom.Attr getAttributeNode(java.lang.String attrName)
          Retrieves an attribute node by name.
 org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
          Retrieves an Attr node by local name and namespace URI.
 java.lang.String getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
          Retrieves an attribute value by local name and namespace URI.
(package private)  boolean getBinary(java.lang.String name)
          Convenience method used to translate an attribute value into a boolean value.
(package private)  java.lang.String getCapitalized(java.lang.String name)
          Convenience method used to capitalize a one-off attribute value before it is returned.
 java.lang.String getClassName()
          The class attribute of the element.
 java.lang.String getDir()
          Specifies the base direction of directionally neutral text and the directionality of tables.
 org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagName)
          Returns a NodeList of all descendant Elements with a given tag name, in the order in which they are encountered in a preorder traversal of this Element tree.
 org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
          Returns a NodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Element tree.
 org.w3c.dom.html.HTMLFormElement getForm()
          Convenience method returns the form in which this form element is contained.
 java.lang.String getId()
          The element's identifier.
(package private)  int getInteger(java.lang.String value)
          Convenience method used to translate an attribute value into an integer value.
 java.lang.String getLang()
          Language code defined in RFC 1766.
 java.lang.String getTitle()
          The element's advisory title.
(package private)  void setAttribute(java.lang.String name, boolean value)
          Convenience method used to set a boolean attribute.
 void setClassName(java.lang.String className)
           
 void setDir(java.lang.String dir)
           
 void setId(java.lang.String id)
           
 void setLang(java.lang.String lang)
           
 void setTitle(java.lang.String title)
           
 
Methods inherited from class org.enhydra.xml.lazydom.LazyElementNoNS
appendChild, appendChildWhileExpanding, areAttributesExpanded, areChildrenExpanded, cloneNode, 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.apache.xerces.dom.ElementImpl
getBaseURI, getDefaultAttributes, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, getTypeName, getTypeNamespace, getXercesAttribute, hasAttribute, hasAttributeNS, hasAttributes, isDerivedFrom, isEqualNode, reconcileDefaultAttributes, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeData
 
Methods inherited from class org.apache.xerces.dom.ParentNode
getChildNodesUnoptimized, getLength, getOwnerDocument, getTextContent, item, setTextContent, synchronizeChildren
 
Methods inherited from class org.apache.xerces.dom.ChildNode
 
Methods inherited from class org.apache.xerces.dom.NodeImpl
addEventListener, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getFeature, getLocalName, getNamespaceURI, getNodeNumber, getNodeValue, getPrefix, getReadOnly, getUserData, getUserData, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, 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
getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS
 
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix
 

Constructor Detail

LazyHTMLElement

LazyHTMLElement(LazyHTMLDocument owner,
                org.enhydra.xml.lazydom.LazyElement template,
                java.lang.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.

Method Detail

getId

public java.lang.String getId()
Description copied from interface: org.w3c.dom.html.HTMLElement
The element's identifier. See the id attribute definition in HTML 4.0.

Specified by:
getId in interface org.w3c.dom.html.HTMLElement

setId

public void setId(java.lang.String id)
Specified by:
setId in interface org.w3c.dom.html.HTMLElement

getTitle

public java.lang.String getTitle()
Description copied from interface: org.w3c.dom.html.HTMLElement
The element's advisory title. See the title attribute definition in HTML 4.0.

Specified by:
getTitle in interface org.w3c.dom.html.HTMLElement

setTitle

public void setTitle(java.lang.String title)
Specified by:
setTitle in interface org.w3c.dom.html.HTMLElement

getLang

public java.lang.String getLang()
Description copied from interface: org.w3c.dom.html.HTMLElement
Language code defined in RFC 1766. See the lang attribute definition in HTML 4.0.

Specified by:
getLang in interface org.w3c.dom.html.HTMLElement

setLang

public void setLang(java.lang.String lang)
Specified by:
setLang in interface org.w3c.dom.html.HTMLElement

getDir

public java.lang.String getDir()
Description copied from interface: org.w3c.dom.html.HTMLElement
Specifies the base direction of directionally neutral text and the directionality of tables. See the dir attribute definition in HTML 4.0.

Specified by:
getDir in interface org.w3c.dom.html.HTMLElement

setDir

public void setDir(java.lang.String dir)
Specified by:
setDir in interface org.w3c.dom.html.HTMLElement

getClassName

public java.lang.String getClassName()
Description copied from interface: org.w3c.dom.html.HTMLElement
The class attribute of the element. This attribute has been renamed due to conflicts with the "class" keyword exposed by many languages. See the class attribute definition in HTML 4.0.

Specified by:
getClassName in interface org.w3c.dom.html.HTMLElement

setClassName

public void setClassName(java.lang.String className)
Specified by:
setClassName in interface org.w3c.dom.html.HTMLElement

getInteger

int getInteger(java.lang.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.


getBinary

boolean getBinary(java.lang.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.


setAttribute

void setAttribute(java.lang.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.


getAttributeNode

public org.w3c.dom.Attr getAttributeNode(java.lang.String attrName)
Description copied from interface: org.w3c.dom.Element
Retrieves an attribute node by name.
To retrieve an attribute node by qualified name and namespace URI, use the getAttributeNodeNS method.

Specified by:
getAttributeNode in interface org.w3c.dom.Element

getAttributeNodeNS

public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI,
                                           java.lang.String localName)
Description copied from interface: org.w3c.dom.Element
Retrieves an Attr node by local name and namespace URI. HTML-only DOM implementations do not need to implement this method.

Specified by:
getAttributeNodeNS in interface org.w3c.dom.Element

getAttribute

public java.lang.String getAttribute(java.lang.String attrName)
Description copied from interface: org.w3c.dom.Element
Retrieves an attribute value by name.

Specified by:
getAttribute in interface org.w3c.dom.Element

getAttributeNS

public java.lang.String getAttributeNS(java.lang.String namespaceURI,
                                       java.lang.String localName)
Description copied from interface: org.w3c.dom.Element
Retrieves an attribute value by local name and namespace URI. HTML-only DOM implementations do not need to implement this method.

Specified by:
getAttributeNS in interface org.w3c.dom.Element

getElementsByTagName

public final org.w3c.dom.NodeList getElementsByTagName(java.lang.String tagName)
Description copied from interface: org.w3c.dom.Element
Returns a NodeList of all descendant Elements with a given tag name, in the order in which they are encountered in a preorder traversal of this Element tree.

Specified by:
getElementsByTagName in interface org.w3c.dom.Element

getElementsByTagNameNS

public final org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI,
                                                         java.lang.String localName)
Description copied from interface: org.w3c.dom.Element
Returns a NodeList of all the descendant Elements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this Element tree.
HTML-only DOM implementations do not need to implement this method.

Specified by:
getElementsByTagNameNS in interface org.w3c.dom.Element

capitalize

java.lang.String capitalize(java.lang.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".


getCapitalized

java.lang.String getCapitalized(java.lang.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".


getForm

public org.w3c.dom.html.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.