org.enhydra.xml.xhtml.dom.xerces
Class XHTMLElementImpl

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.apache.xerces.dom.ElementNSImpl
                                |
                                +--org.enhydra.xml.xhtml.dom.xerces.XHTMLElementImpl
All Implemented Interfaces:
Cloneable, Element, EventTarget, HTMLElement, Node, NodeList, Serializable
Direct Known Subclasses:
XHTMLAbbrElementImpl, XHTMLAcronymElementImpl, XHTMLAddressElementImpl, XHTMLAnchorElementImpl, XHTMLAppletElementImpl, XHTMLAreaElementImpl, XHTMLBaseElementImpl, XHTMLBaseFontElementImpl, XHTMLBdoElementImpl, XHTMLBElementImpl, XHTMLBigElementImpl, XHTMLBodyElementImpl, XHTMLBRElementImpl, XHTMLButtonElementImpl, XHTMLCenterElementImpl, XHTMLCiteElementImpl, XHTMLCodeElementImpl, XHTMLDdElementImpl, XHTMLDfnElementImpl, XHTMLDirectoryElementImpl, XHTMLDivElementImpl, XHTMLDListElementImpl, XHTMLDtElementImpl, XHTMLEmElementImpl, XHTMLFieldSetElementImpl, XHTMLFontElementImpl, XHTMLFormElementImpl, XHTMLFrameElementImpl, XHTMLFrameSetElementImpl, XHTMLHeadElementImpl, XHTMLHeadingElementImpl, XHTMLHRElementImpl, XHTMLHtmlElementImpl, XHTMLIElementImpl, XHTMLIFrameElementImpl, XHTMLImageElementImpl, XHTMLInputElementImpl, XHTMLIsIndexElementImpl, XHTMLKbdElementImpl, XHTMLLabelElementImpl, XHTMLLegendElementImpl, XHTMLLIElementImpl, XHTMLLinkElementImpl, XHTMLMapElementImpl, XHTMLMenuElementImpl, XHTMLMetaElementImpl, XHTMLModElementImpl, XHTMLNoframesElementImpl, XHTMLNoscriptElementImpl, XHTMLObjectElementImpl, XHTMLOListElementImpl, XHTMLOptGroupElementImpl, XHTMLOptionElementImpl, XHTMLParagraphElementImpl, XHTMLParamElementImpl, XHTMLPreElementImpl, XHTMLQuoteElementImpl, XHTMLSampElementImpl, XHTMLScriptElementImpl, XHTMLSelectElementImpl, XHTMLSElementImpl, XHTMLSmallElementImpl, XHTMLSpanElementImpl, XHTMLStrikeElementImpl, XHTMLStrongElementImpl, XHTMLStyleElementImpl, XHTMLSubElementImpl, XHTMLSupElementImpl, XHTMLTableCaptionElementImpl, XHTMLTableCellElementImpl, XHTMLTableColElementImpl, XHTMLTableElementImpl, XHTMLTableRowElementImpl, XHTMLTableSectionElementImpl, XHTMLTextAreaElementImpl, XHTMLTitleElementImpl, XHTMLTtElementImpl, XHTMLUElementImpl, XHTMLUListElementImpl, XHTMLVarElementImpl

public class XHTMLElementImpl
extends org.enhydra.apache.xerces.dom.ElementNSImpl
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.

See Also:
HTMLElement, Serialized Form

Field Summary
 
Fields inherited from class org.enhydra.apache.xerces.dom.ElementNSImpl
localName, namespaceURI
 
Fields inherited from class org.enhydra.apache.xerces.dom.ElementImpl
attributes, name
 
Fields inherited from class org.enhydra.apache.xerces.dom.ParentNode
fCachedChild, fCachedChildIndex, fCachedLength, firstChild, ownerDocument
 
Fields inherited from class org.enhydra.apache.xerces.dom.ChildNode
nextSibling, previousSibling
 
Fields inherited from class org.enhydra.apache.xerces.dom.NodeImpl
ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, IGNORABLEWS, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, UNNORMALIZED
 
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
 
Constructor Summary
(package private) XHTMLElementImpl(XHTMLDocumentBase owner, String namespaceURI, 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)
           
protected  boolean getBooleanAttribute(String attr)
           
protected  boolean getBooleanAttribute(String attr, boolean defaultValue)
           
(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()
           
protected  int getIntAttribute(String attr)
           
protected  int getIntAttribute(String attr, int defaultValue)
           
 String getLang()
           
 String getTitle()
           
protected  void setAttribute(String attr, boolean value)
           
protected  void setAttribute(String attr, int value)
           
 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.apache.xerces.dom.ElementNSImpl
getLocalName, getNamespaceURI, getPrefix, setPrefix
 
Methods inherited from class org.enhydra.apache.xerces.dom.ElementImpl
cloneNode, getAttributes, getDefaultAttributes, getNodeName, getNodeType, getTagName, hasAttribute, hasAttributeNS, hasAttributes, normalize, reconcileDefaultAttributes, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setReadOnly, setupDefaultAttributes, synchronizeData
 
Methods inherited from class org.enhydra.apache.xerces.dom.ParentNode
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, hasChildNodes, insertBefore, item, removeChild, replaceChild, synchronizeChildren
 
Methods inherited from class org.enhydra.apache.xerces.dom.ChildNode
getNextSibling, getParentNode, getPreviousSibling
 
Methods inherited from class org.enhydra.apache.xerces.dom.NodeImpl
addEventListener, appendChild, changed, changes, dispatchEvent, getNodeValue, getReadOnly, getUserData, isSupported, removeEventListener, setNodeValue, 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

XHTMLElementImpl

XHTMLElementImpl(XHTMLDocumentBase owner,
                 String namespaceURI,
                 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
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

getAttributeNode

public Attr getAttributeNode(String attrName)
Specified by:
getAttributeNode in interface Element
Overrides:
getAttributeNode in class org.enhydra.apache.xerces.dom.ElementImpl

getAttributeNodeNS

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

getAttribute

public String getAttribute(String attrName)
Specified by:
getAttribute in interface Element
Overrides:
getAttribute in class org.enhydra.apache.xerces.dom.ElementImpl

getAttributeNS

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

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.


getBooleanAttribute

protected final boolean getBooleanAttribute(String attr,
                                            boolean defaultValue)

getBooleanAttribute

protected final boolean getBooleanAttribute(String attr)

setAttribute

protected final void setAttribute(String attr,
                                  boolean value)

getIntAttribute

protected final int getIntAttribute(String attr,
                                    int defaultValue)

getIntAttribute

protected final int getIntAttribute(String attr)

setAttribute

protected final void setAttribute(String attr,
                                  int value)


Copyright © 1999-2002 Mark Diekhans, enhydra.org. All Rights reserved.