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
- 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.1.1.1 $ $Date: 2003/03/10 16:36:19 $
- Author:
- Assaf Arkin
- See Also:
HTMLElement
,
Serialized Form
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 |
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.enhydra.apache.xerces.dom.ElementImpl |
getDefaultAttributes, getNodeName, getNodeType, getTagName, hasAttribute, hasAttributeNS, hasAttributes, reconcileDefaultAttributes, setReadOnly, setupDefaultAttributes, synchronizeData |
Methods inherited from class org.enhydra.apache.xerces.dom.ParentNode |
getChildNodesUnoptimized, getLength, getOwnerDocument, item, synchronizeChildren |
Methods inherited from class org.enhydra.apache.xerces.dom.ChildNode |
|
Methods inherited from class org.enhydra.apache.xerces.dom.NodeImpl |
addEventListener, changed, changes, dispatchEvent, getLocalName, getNamespaceURI, getNodeValue, getPrefix, getReadOnly, getUserData, isSupported, removeEventListener, setPrefix, setUserData, toString |
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 |
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 documenttemplate
- If not null, then this template will be used to
initialize the Element.tagName
- The element's tag name
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.
- 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 attributevalue
- The value of the attribute
getAttributeNode
public Attr getAttributeNode(String attrName)
- Specified by:
getAttributeNode
in interface Element
- Overrides:
getAttributeNode
in class 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
- 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
- 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
- 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.