Top Description Fields Constructors Methods
org.apache.html.dom

public Class HTMLElementImpl

extends ElementImpl
implements HTMLElement
Class Inheritance
All Implemented Interfaces
org.w3c.dom.html.HTMLElement, org.w3c.dom.Element, org.w3c.dom.Node
Known Direct Subclasses
org.apache.html.dom.HTMLFieldSetElementImpl, org.apache.html.dom.HTMLFontElementImpl, org.apache.html.dom.HTMLFormElementImpl, org.apache.html.dom.HTMLFrameElementImpl, org.apache.html.dom.HTMLFrameSetElementImpl, org.apache.html.dom.HTMLHeadElementImpl, org.apache.html.dom.HTMLHeadingElementImpl, org.apache.html.dom.HTMLHRElementImpl, org.apache.html.dom.HTMLHtmlElementImpl, org.apache.html.dom.HTMLIFrameElementImpl, org.apache.html.dom.HTMLImageElementImpl, org.apache.html.dom.HTMLInputElementImpl, org.apache.html.dom.HTMLLabelElementImpl, org.apache.html.dom.HTMLLegendElementImpl, org.apache.html.dom.HTMLLIElementImpl, org.apache.html.dom.HTMLLinkElementImpl, org.apache.html.dom.HTMLMapElementImpl, org.apache.html.dom.HTMLMenuElementImpl, org.apache.html.dom.HTMLMetaElementImpl, org.apache.html.dom.HTMLModElementImpl, org.apache.html.dom.HTMLObjectElementImpl, org.apache.html.dom.HTMLOListElementImpl, org.apache.html.dom.HTMLOptGroupElementImpl, org.apache.html.dom.HTMLOptionElementImpl, org.apache.html.dom.HTMLParagraphElementImpl, org.apache.html.dom.HTMLParamElementImpl, org.apache.html.dom.HTMLQuoteElementImpl, org.apache.html.dom.HTMLScriptElementImpl, org.apache.html.dom.HTMLSelectElementImpl, org.apache.html.dom.HTMLStyleElementImpl, org.apache.html.dom.HTMLTableCaptionElementImpl, org.apache.html.dom.HTMLTableCellElementImpl, org.apache.html.dom.HTMLTableColElementImpl, org.apache.html.dom.HTMLTableElementImpl, org.apache.html.dom.HTMLTableRowElementImpl, org.apache.html.dom.HTMLTableSectionElementImpl, org.apache.html.dom.HTMLTextAreaElementImpl, org.apache.html.dom.HTMLTitleElementImpl, org.apache.html.dom.HTMLUListElementImpl, org.apache.html.dom.HTMLIsIndexElementImpl, org.apache.html.dom.HTMLPreElementImpl, org.apache.html.dom.HTMLAnchorElementImpl, org.apache.html.dom.HTMLAppletElementImpl, org.apache.html.dom.HTMLAreaElementImpl, org.apache.html.dom.HTMLBaseElementImpl, org.apache.html.dom.HTMLBaseFontElementImpl, org.apache.html.dom.HTMLBodyElementImpl, org.apache.html.dom.HTMLBRElementImpl, org.apache.html.dom.HTMLButtonElementImpl, org.apache.html.dom.HTMLDirectoryElementImpl, org.apache.html.dom.HTMLDivElementImpl, org.apache.html.dom.HTMLDListElementImpl
Imports
java.util.Locale, org.apache.xerces.dom.ElementImpl, org.w3c.dom.Attr, .Node, .NodeList, org.w3c.dom.html.HTMLElement, .HTMLFormElement

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.
Author
Assaf Arkin
Version
$Revision: 1029415 $ $Date: 2010-10-31 22:32:22 +0530 (Sun, 31 Oct 2010) $
See Also
org.w3c.dom.html.HTMLElement

Field Summary

Modifier and TypeField and Description
private static final long
Inherited from org.apache.xerces.dom.ElementImpl:
attributesname

Constructor Summary

AccessConstructor and Description
public
HTMLElementImpl(HTMLDocumentImpl
The owner HTML document
owner
,
String
The element's tag name
tagName
)

Constructor required owner document and element tag name.

Method Summary

Modifier and TypeMethod and Description
pack-priv String

Returns:

The capitalized value
capitalize
(String
The value of the attribute
value
)

Convenience method used to capitalize a one-off attribute value before it is returned.

public String
getAttribute(String
The name of the attribute to retrieve.
attrName
)

Overrides org.apache.xerces.dom.ElementImpl.getAttribute.

Implements org.w3c.dom.Element.getAttribute.

Retrieves an attribute value by name.
public Attr
getAttributeNode(String
The name (nodeName) of the attribute to retrieve.
attrName
)

Overrides org.apache.xerces.dom.ElementImpl.getAttributeNode.

Implements org.w3c.dom.Element.getAttributeNode.

Retrieves an attribute node by name.
public Attr
getAttributeNodeNS(String
The namespace URI of the attribute to retrieve.
namespaceURI
,
String
The local name of the attribute to retrieve.
localName
)

Overrides org.apache.xerces.dom.ElementImpl.getAttributeNodeNS.

Implements org.w3c.dom.Element.getAttributeNodeNS.

Retrieves an Attr node by local name and namespace URI.
public String
getAttributeNS(String
The namespace URI of the attribute to retrieve.
namespaceURI
,
String
The local name of the attribute to retrieve.
localName
)

Overrides org.apache.xerces.dom.ElementImpl.getAttributeNS.

Implements org.w3c.dom.Element.getAttributeNS.

Retrieves an attribute value by local name and namespace URI.
pack-priv boolean

Returns:

True or false depending on whether the attribute has been set
getBinary
(String
The value of the attribute
name
)

Convenience method used to translate an attribute value into a boolean value.

pack-priv String

Returns:

The capitalized value
getCapitalized
(String
The name of the attribute
name
)

Convenience method used to capitalize a one-off attribute value before it is returned.

public String
getClassName()

Implements org.w3c.dom.html.HTMLElement.getClassName.

The class attribute of the element.
public String
getDir()

Implements org.w3c.dom.html.HTMLElement.getDir.

Specifies the base direction of directionally neutral text and the directionality of tables.
public final NodeList
getElementsByTagName(String
The name of the tag to match on. The special value "*" matches all tags.
tagName
)

Overrides org.apache.xerces.dom.ElementImpl.getElementsByTagName.

Implements org.w3c.dom.Element.getElementsByTagName.

Returns a NodeList of all descendant Elements with a given tag name, in document order.
public final NodeList
getElementsByTagNameNS(String
The namespace URI of the elements to match on. The special value "*" matches all namespaces.
namespaceURI
,
String
The local name of the elements to match on. The special value "*" matches all local names.
localName
)

Overrides org.apache.xerces.dom.ElementImpl.getElementsByTagNameNS.

Implements org.w3c.dom.Element.getElementsByTagNameNS.

Returns a NodeList of all the descendant Elements with a given local name and namespace URI in document order.
public HTMLFormElement
getForm()

Convenience method returns the form in which this form element is contained.

public String
getId()

Implements org.w3c.dom.html.HTMLElement.getId.

The element's identifier.
pack-priv int

Returns:

The integer value, or zero if not a valid numeric string
getInteger
(String
The value of the attribute
value
)

Convenience method used to translate an attribute value into an integer value.

public String
getLang()

Implements org.w3c.dom.html.HTMLElement.getLang.

Language code defined in RFC 1766.
public String
getTitle()

Implements org.w3c.dom.html.HTMLElement.getTitle.

The element's advisory title.
pack-priv void
setAttribute(String
The name of the attribute
name
,
boolean
The value of the attribute
value
)

Convenience method used to set a boolean attribute.

public void
public void
public void
public void
public void
Inherited from org.apache.xerces.dom.ElementImpl:
cloneNodegetAttributesgetBaseURIgetChildElementCountgetDefaultAttributesgetFirstElementChildgetLastElementChildgetNextElementSiblinggetNodeNamegetNodeTypegetPreviousElementSiblinggetSchemaTypeInfogetTagNamegetTypeNamegetTypeNamespacegetXercesAttributegetXMLBaseAttributehasAttributehasAttributeNShasAttributesisDerivedFromisEqualNodenormalizereconcileDefaultAttributesremoveAttributeremoveAttributeNoderemoveAttributeNSsetAttributesetAttributeNodesetAttributeNodeNSsetAttributeNSsetIdAttributesetIdAttributeNodesetIdAttributeNSsetOwnerDocumentsetReadOnlysetupDefaultAttributessetXercesAttributeNodesynchronizeData

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides org.apache.xerces.dom.ElementImpl.serialVersionUID.

Constructor Detail

HTMLElementImplback to summary
public HTMLElementImpl(HTMLDocumentImpl owner, 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:HTMLDocumentImpl

The owner HTML document

tagName:String

The element's tag name

Method Detail

capitalizeback to summary
pack-priv 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:String

The value of the attribute

Returns:String

The capitalized value

getAttributeback to summary
public String getAttribute(String attrName)

Overrides org.apache.xerces.dom.ElementImpl.getAttribute.

Implements org.w3c.dom.Element.getAttribute.

Doc from org.w3c.dom.Element.getAttribute.

Retrieves an attribute value by name.

Parameters
attrName:String

The name of the attribute to retrieve.

Returns:String

The Attr value as a string, or the empty string if that attribute does not have a specified or default value.

getAttributeNodeback to summary
public Attr getAttributeNode(String attrName)

Overrides org.apache.xerces.dom.ElementImpl.getAttributeNode.

Implements org.w3c.dom.Element.getAttributeNode.

Doc from org.w3c.dom.Element.getAttributeNode.

Retrieves an attribute node by name.
To retrieve an attribute node by qualified name and namespace URI, use the getAttributeNodeNS method.

Parameters
attrName:String

The name (nodeName) of the attribute to retrieve.

Returns:Attr

The Attr node with the specified name ( nodeName) or null if there is no such attribute.

getAttributeNodeNSback to summary
public Attr getAttributeNodeNS(String namespaceURI, String localName)

Overrides org.apache.xerces.dom.ElementImpl.getAttributeNodeNS.

Implements org.w3c.dom.Element.getAttributeNodeNS.

Doc from org.w3c.dom.Element.getAttributeNodeNS.

Retrieves an Attr node by local name and namespace URI.
Per [XML Namespaces] , applications must use the value null as the namespaceURI parameter for methods if they wish to have no namespace.

Parameters
namespaceURI:String

The namespace URI of the attribute to retrieve.

localName:String

The local name of the attribute to retrieve.

Returns:Attr

The Attr node with the specified attribute local name and namespace URI or null if there is no such attribute.

getAttributeNSback to summary
public String getAttributeNS(String namespaceURI, String localName)

Overrides org.apache.xerces.dom.ElementImpl.getAttributeNS.

Implements org.w3c.dom.Element.getAttributeNS.

Doc from org.w3c.dom.Element.getAttributeNS.

Retrieves an attribute value by local name and namespace URI.
Per [XML Namespaces] , applications must use the value null as the namespaceURI parameter for methods if they wish to have no namespace.

Parameters
namespaceURI:String

The namespace URI of the attribute to retrieve.

localName:String

The local name of the attribute to retrieve.

Returns:String

The Attr value as a string, or the empty string if that attribute does not have a specified or default value.

getBinaryback to summary
pack-priv 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
name:String

The value of the attribute

Returns:boolean

True or false depending on whether the attribute has been set

getCapitalizedback to summary
pack-priv 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:String

The name of the attribute

Returns:String

The capitalized value

getClassNameback to summary
public String getClassName()

Implements org.w3c.dom.html.HTMLElement.getClassName.

Doc from org.w3c.dom.html.HTMLElement.getClassName.

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.

getDirback to summary
public String getDir()

Implements org.w3c.dom.html.HTMLElement.getDir.

Doc from org.w3c.dom.html.HTMLElement.getDir.

Specifies the base direction of directionally neutral text and the directionality of tables. See the dir attribute definition in HTML 4.0.

getElementsByTagNameback to summary
public final NodeList getElementsByTagName(String tagName)

Overrides org.apache.xerces.dom.ElementImpl.getElementsByTagName.

Implements org.w3c.dom.Element.getElementsByTagName.

Doc from org.w3c.dom.Element.getElementsByTagName.

Returns a NodeList of all descendant Elements with a given tag name, in document order.

Parameters
tagName:String

The name of the tag to match on. The special value "*" matches all tags.

Returns:NodeList

A list of matching Element nodes.

getElementsByTagNameNSback to summary
public final NodeList getElementsByTagNameNS(String namespaceURI, String localName)

Overrides org.apache.xerces.dom.ElementImpl.getElementsByTagNameNS.

Implements org.w3c.dom.Element.getElementsByTagNameNS.

Doc from org.w3c.dom.Element.getElementsByTagNameNS.

Returns a NodeList of all the descendant Elements with a given local name and namespace URI in document order.

Parameters
namespaceURI:String

The namespace URI of the elements to match on. The special value "*" matches all namespaces.

localName:String

The local name of the elements to match on. The special value "*" matches all local names.

Returns:NodeList

A new NodeList object containing all the matched Elements.

getFormback to summary
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.

getIdback to summary
public String getId()

Implements org.w3c.dom.html.HTMLElement.getId.

Doc from org.w3c.dom.html.HTMLElement.getId.

The element's identifier. See the id attribute definition in HTML 4.0.

getIntegerback to summary
pack-priv 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:String

The value of the attribute

Returns:int

The integer value, or zero if not a valid numeric string

getLangback to summary
public String getLang()

Implements org.w3c.dom.html.HTMLElement.getLang.

Doc from org.w3c.dom.html.HTMLElement.getLang.

Language code defined in RFC 1766. See the lang attribute definition in HTML 4.0.

getTitleback to summary
public String getTitle()

Implements org.w3c.dom.html.HTMLElement.getTitle.

Doc from org.w3c.dom.html.HTMLElement.getTitle.

The element's advisory title. See the title attribute definition in HTML 4.0.

setAttributeback to summary
pack-priv 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:String

The name of the attribute

value:boolean

The value of the attribute

setClassNameback to summary
public void setClassName(String className)

Implements org.w3c.dom.html.HTMLElement.setClassName.

setDirback to summary
public void setDir(String dir)

Implements org.w3c.dom.html.HTMLElement.setDir.

setIdback to summary
public void setId(String id)

Implements org.w3c.dom.html.HTMLElement.setId.

setLangback to summary
public void setLang(String lang)

Implements org.w3c.dom.html.HTMLElement.setLang.

setTitleback to summary
public void setTitle(String title)

Implements org.w3c.dom.html.HTMLElement.setTitle.