APIdia Launch Partner
Top Fields Constructors Methods
com.sun.org.apache.xerces.internal.impl.xs.opti

public Class DefaultElement

extends NodeImpl
implements Element
Class Inheritance
All Implemented Interfaces
org.w3c.dom.Element, org.w3c.dom.Node
Known Direct Subclasses
com.sun.org.apache.xerces.internal.impl.xs.opti.ElementImpl
Imports
org.w3c.dom.TypeInfo, .Attr, .Element, .NodeList, .DOMException

Author
Rahul Srivastava, Sun Microsystems Inc.

Field Summary

Inherited from com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl:
hiddenlocalpartnodeTypeprefixrawnameuri

Constructor Summary

AccessConstructor and Description
public
public
DefaultElement(String prefix, String localpart, String rawname, String uri, short nodeType)

Method Summary

Modifier and TypeMethod and Description
public String
getAttribute(String name)

Implements org.w3c.dom.Element.getAttribute.

Retrieves an attribute value by name.

public Attr
getAttributeNode(String name)

Implements org.w3c.dom.Element.getAttributeNode.

Retrieves an attribute node by name.

public Attr
getAttributeNodeNS(String namespaceURI, String localName)

Implements org.w3c.dom.Element.getAttributeNodeNS.

Retrieves an Attr node by local name and namespace URI.

public String
getAttributeNS(String namespaceURI, String localName)

Implements org.w3c.dom.Element.getAttributeNS.

Retrieves an attribute value by local name and namespace URI.

public NodeList
getElementsByTagName(String name)

Implements org.w3c.dom.Element.getElementsByTagName.

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

public NodeList
getElementsByTagNameNS(String namespaceURI, String localName)

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 TypeInfo
getSchemaTypeInfo()

Implements org.w3c.dom.Element.getSchemaTypeInfo.

The type information associated with this element.

public String
getTagName()

Implements org.w3c.dom.Element.getTagName.

The name of the element.

public boolean
hasAttribute(String name)

Implements org.w3c.dom.Element.hasAttribute.

Returns true when an attribute with a given name is specified on this element or has a default value, false otherwise.

public boolean
hasAttributeNS(String namespaceURI, String localName)

Implements org.w3c.dom.Element.hasAttributeNS.

Returns true when an attribute with a given local name and namespace URI is specified on this element or has a default value, false otherwise.

public void
removeAttribute(String name)

Implements org.w3c.dom.Element.removeAttribute.

Removes an attribute by name.

public Attr
removeAttributeNode(Attr oldAttr)

Implements org.w3c.dom.Element.removeAttributeNode.

Removes the specified attribute node.

public void
removeAttributeNS(String namespaceURI, String localName)

Implements org.w3c.dom.Element.removeAttributeNS.

Removes an attribute by local name and namespace URI.

public void
setAttribute(String name, String value)

Implements org.w3c.dom.Element.setAttribute.

Adds a new attribute.

public Attr
setAttributeNode(Attr newAttr)

Implements org.w3c.dom.Element.setAttributeNode.

Adds a new attribute node.

public Attr
setAttributeNodeNS(Attr newAttr)

Implements org.w3c.dom.Element.setAttributeNodeNS.

Adds a new attribute.

public void
setAttributeNS(String namespaceURI, String qualifiedName, String value)

Implements org.w3c.dom.Element.setAttributeNS.

Adds a new attribute.

public void
setIdAttribute(String name, boolean makeId)

Implements org.w3c.dom.Element.setIdAttribute.

If the parameter isId is true, this method declares the specified attribute to be a user-determined ID attribute .

public void
setIdAttributeNode(Attr at, boolean makeId)

Implements org.w3c.dom.Element.setIdAttributeNode.

If the parameter isId is true, this method declares the specified attribute to be a user-determined ID attribute .

public void
setIdAttributeNS(String namespaceURI, String localName, boolean makeId)

Implements org.w3c.dom.Element.setIdAttributeNS.

If the parameter isId is true, this method declares the specified attribute to be a user-determined ID attribute .

Inherited from com.sun.org.apache.xerces.internal.impl.xs.opti.NodeImpl:
getLocalNamegetNamespaceURIgetNodeNamegetNodeTypegetPrefixgetReadOnlysetReadOnly

Constructor Detail

DefaultElementback to summary
public DefaultElement()
DefaultElementback to summary
public DefaultElement(String prefix, String localpart, String rawname, String uri, short nodeType)

Method Detail

getAttributeback to summary
public String getAttribute(String name)

Implements org.w3c.dom.Element.getAttribute.

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

Retrieves an attribute value by name.

getAttributeNodeback to summary
public Attr getAttributeNode(String name)

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.

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

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.

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

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.

getElementsByTagNameback to summary
public NodeList getElementsByTagName(String name)

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.

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

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.

getSchemaTypeInfoback to summary
public TypeInfo getSchemaTypeInfo()

Implements org.w3c.dom.Element.getSchemaTypeInfo.

Doc from org.w3c.dom.Element.getSchemaTypeInfo.

The type information associated with this element.

getTagNameback to summary
public String getTagName()

Implements org.w3c.dom.Element.getTagName.

Doc from org.w3c.dom.Element.getTagName.

The name of the element. If Node.localName is different from null, this attribute is a qualified name. For example, in:

 <elementExample id="demo"> ...
</elementExample> , 
tagName has the value "elementExample". Note that this is case-preserving in XML, as are all of the operations of the DOM. The HTML DOM returns the tagName of an HTML element in the canonical uppercase form, regardless of the case in the source HTML document.
hasAttributeback to summary
public boolean hasAttribute(String name)

Implements org.w3c.dom.Element.hasAttribute.

Doc from org.w3c.dom.Element.hasAttribute.

Returns true when an attribute with a given name is specified on this element or has a default value, false otherwise.

hasAttributeNSback to summary
public boolean hasAttributeNS(String namespaceURI, String localName)

Implements org.w3c.dom.Element.hasAttributeNS.

Doc from org.w3c.dom.Element.hasAttributeNS.

Returns true when an attribute with a given local name and namespace URI is specified on this element or has a default value, false otherwise.
Per [XML Namespaces] , applications must use the value null as the namespaceURI parameter for methods if they wish to have no namespace.

removeAttributeback to summary
public void removeAttribute(String name) throws DOMException

Implements org.w3c.dom.Element.removeAttribute.

Doc from org.w3c.dom.Element.removeAttribute.

Removes an attribute by name. If a default value for the removed attribute is defined in the DTD, a new attribute immediately appears with the default value as well as the corresponding namespace URI, local name, and prefix when applicable. The implementation may handle default values from other schemas similarly but applications should use Document.normalizeDocument() to guarantee this information is up-to-date.
If no attribute with this name is found, this method has no effect.
To remove an attribute by local name and namespace URI, use the removeAttributeNS method.

Exceptions
DOMException:
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
removeAttributeNodeback to summary
public Attr removeAttributeNode(Attr oldAttr) throws DOMException

Implements org.w3c.dom.Element.removeAttributeNode.

Doc from org.w3c.dom.Element.removeAttributeNode.

Removes the specified attribute node. If a default value for the removed Attr node is defined in the DTD, a new node immediately appears with the default value as well as the corresponding namespace URI, local name, and prefix when applicable. The implementation may handle default values from other schemas similarly but applications should use Document.normalizeDocument() to guarantee this information is up-to-date.

Exceptions
DOMException:
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if oldAttr is not an attribute of the element.
removeAttributeNSback to summary
public void removeAttributeNS(String namespaceURI, String localName) throws DOMException

Implements org.w3c.dom.Element.removeAttributeNS.

Doc from org.w3c.dom.Element.removeAttributeNS.

Removes an attribute by local name and namespace URI. If a default value for the removed attribute is defined in the DTD, a new attribute immediately appears with the default value as well as the corresponding namespace URI, local name, and prefix when applicable. The implementation may handle default values from other schemas similarly but applications should use Document.normalizeDocument() to guarantee this information is up-to-date.
If no attribute with this local name and namespace URI is found, this method has no effect.
Per [XML Namespaces] , applications must use the value null as the namespaceURI parameter for methods if they wish to have no namespace.

Exceptions
DOMException:
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_SUPPORTED_ERR: May be raised if the implementation does not support the feature "XML" and the language exposed through the Document does not support XML Namespaces (such as [HTML 4.01]).
setAttributeback to summary
public void setAttribute(String name, String value) throws DOMException

Implements org.w3c.dom.Element.setAttribute.

Doc from org.w3c.dom.Element.setAttribute.

Adds a new attribute. If an attribute with that name is already present in the element, its value is changed to be that of the value parameter. This value is a simple string; it is not parsed as it is being set. So any markup (such as syntax to be recognized as an entity reference) is treated as literal text, and needs to be appropriately escaped by the implementation when it is written out. In order to assign an attribute value that contains entity references, the user must create an Attr node plus any Text and EntityReference nodes, build the appropriate subtree, and use setAttributeNode to assign it as the value of an attribute.
To set an attribute with a qualified name and namespace URI, use the setAttributeNS method.

Exceptions
DOMException:
INVALID_CHARACTER_ERR: Raised if the specified name is not an XML name according to the XML version in use specified in the Document.xmlVersion attribute.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
setAttributeNodeback to summary
public Attr setAttributeNode(Attr newAttr) throws DOMException

Implements org.w3c.dom.Element.setAttributeNode.

Doc from org.w3c.dom.Element.setAttributeNode.

Adds a new attribute node. If an attribute with that name ( nodeName) is already present in the element, it is replaced by the new one. Replacing an attribute node by itself has no effect.
To add a new attribute node with a qualified name and namespace URI, use the setAttributeNodeNS method.

Exceptions
DOMException:
WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
INUSE_ATTRIBUTE_ERR: Raised if newAttr is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.
setAttributeNodeNSback to summary
public Attr setAttributeNodeNS(Attr newAttr) throws DOMException

Implements org.w3c.dom.Element.setAttributeNodeNS.

Doc from org.w3c.dom.Element.setAttributeNodeNS.

Adds a new attribute. If an attribute with that local name and that namespace URI is already present in the element, it is replaced by the new one. Replacing an attribute node by itself has no effect.
Per [XML Namespaces] , applications must use the value null as the namespaceURI parameter for methods if they wish to have no namespace.

Exceptions
DOMException:
WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
INUSE_ATTRIBUTE_ERR: Raised if newAttr is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.
NOT_SUPPORTED_ERR: May be raised if the implementation does not support the feature "XML" and the language exposed through the Document does not support XML Namespaces (such as [HTML 4.01]).
setAttributeNSback to summary
public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException

Implements org.w3c.dom.Element.setAttributeNS.

Doc from org.w3c.dom.Element.setAttributeNS.

Adds a new attribute. If an attribute with the same local name and namespace URI is already present on the element, its prefix is changed to be the prefix part of the qualifiedName, and its value is changed to be the value parameter. This value is a simple string; it is not parsed as it is being set. So any markup (such as syntax to be recognized as an entity reference) is treated as literal text, and needs to be appropriately escaped by the implementation when it is written out. In order to assign an attribute value that contains entity references, the user must create an Attr node plus any Text and EntityReference nodes, build the appropriate subtree, and use setAttributeNodeNS or setAttributeNode to assign it as the value of an attribute.
Per [XML Namespaces] , applications must use the value null as the namespaceURI parameter for methods if they wish to have no namespace.

Exceptions
DOMException:
INVALID_CHARACTER_ERR: Raised if the specified qualified name is not an XML name according to the XML version in use specified in the Document.xmlVersion attribute.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NAMESPACE_ERR: Raised if the qualifiedName is malformed per the Namespaces in XML specification, if the qualifiedName has a prefix and the namespaceURI is null, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from " http://www.w3.org/XML/1998/namespace", if the qualifiedName or its prefix is "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/", or if the namespaceURI is "http://www.w3.org/2000/xmlns/" and neither the qualifiedName nor its prefix is "xmlns".
NOT_SUPPORTED_ERR: May be raised if the implementation does not support the feature "XML" and the language exposed through the Document does not support XML Namespaces (such as [HTML 4.01]).
setIdAttributeback to summary
public void setIdAttribute(String name, boolean makeId) throws DOMException

Implements org.w3c.dom.Element.setIdAttribute.

Doc from org.w3c.dom.Element.setIdAttribute.

If the parameter isId is true, this method declares the specified attribute to be a user-determined ID attribute . This affects the value of Attr.isId and the behavior of Document.getElementById, but does not change any schema that may be in use, in particular this does not affect the Attr.schemaTypeInfo of the specified Attr node. Use the value false for the parameter isId to undeclare an attribute for being a user-determined ID attribute.
To specify an attribute by local name and namespace URI, use the setIdAttributeNS method.

Exceptions
DOMException:
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if the specified node is not an attribute of this element.
setIdAttributeNodeback to summary
public void setIdAttributeNode(Attr at, boolean makeId) throws DOMException

Implements org.w3c.dom.Element.setIdAttributeNode.

Doc from org.w3c.dom.Element.setIdAttributeNode.

If the parameter isId is true, this method declares the specified attribute to be a user-determined ID attribute . This affects the value of Attr.isId and the behavior of Document.getElementById, but does not change any schema that may be in use, in particular this does not affect the Attr.schemaTypeInfo of the specified Attr node. Use the value false for the parameter isId to undeclare an attribute for being a user-determined ID attribute.

Exceptions
DOMException:
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if the specified node is not an attribute of this element.
setIdAttributeNSback to summary
public void setIdAttributeNS(String namespaceURI, String localName, boolean makeId) throws DOMException

Implements org.w3c.dom.Element.setIdAttributeNS.

Doc from org.w3c.dom.Element.setIdAttributeNS.

If the parameter isId is true, this method declares the specified attribute to be a user-determined ID attribute . This affects the value of Attr.isId and the behavior of Document.getElementById, but does not change any schema that may be in use, in particular this does not affect the Attr.schemaTypeInfo of the specified Attr node. Use the value false for the parameter isId to undeclare an attribute for being a user-determined ID attribute.

Exceptions
DOMException:
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if the specified node is not an attribute of this element.