org.apache.xerces.dom

Class ElementNSImpl

Implemented Interfaces:
Cloneable, org.w3c.dom.Element, org.w3c.dom.events.EventTarget, org.w3c.dom.Node, org.w3c.dom.NodeList, Serializable, org.w3c.dom.TypeInfo
Known Direct Subclasses:
DeferredElementNSImpl, PSVIElementNSImpl

public class ElementNSImpl
extends ElementImpl

ElementNSImpl inherits from ElementImpl and adds namespace support.

The qualified name is the node name, and we store localName which is also used in all queries. On the other hand we recompute the prefix when necessary.

Version:
$Id: ElementNSImpl.java 320344 2005-05-10 15:36:42Z ankitp $
Authors:
Elena litani, IBM
Neeraj Bajaj, Sun Microsystems

Field Summary

protected String
localName
DOM2: localName.
protected String
namespaceURI
DOM2: Namespace URI.

Fields inherited from class org.apache.xerces.dom.ElementImpl

attributes, name

Fields inherited from class org.apache.xerces.dom.ParentNode

fNodeListCache, firstChild, 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, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, 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, flags, ownerNode

Fields inherited from interface org.w3c.dom.Node

ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE

Fields inherited from interface org.w3c.dom.TypeInfo

DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION

Constructor Summary

ElementNSImpl()
ElementNSImpl(CoreDocumentImpl ownerDocument, String value)
ElementNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI, String qualifiedName)
DOM2: Constructor for Namespace implementation.
ElementNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI, String qualifiedName, String localName)

Method Summary

String
getBaseURI()
DOM Level 3 WD - Experimental.
String
getLocalName()
Introduced in DOM Level 2.
String
getNamespaceURI()
Introduced in DOM Level 2.
String
getPrefix()
Introduced in DOM Level 2.
String
getTypeName()
String
getTypeNamespace()
boolean
isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)
Introduced in DOM Level 2.
void
setPrefix(String prefix)
Introduced in DOM Level 2.
void
setType(org.apache.xerces.xs.XSTypeDefinition type)
NON-DOM: setting type used by the DOM parser
protected void
setValues(CoreDocumentImpl ownerDocument, String namespaceURI, String qualifiedName, String localName)
NON-DOM: resets this node and sets specified values for the node

Methods inherited from class org.apache.xerces.dom.ElementImpl

cloneNode, getAttribute, getAttributeNS, getAttributeNode, getAttributeNodeNS, getAttributes, getBaseURI, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, getTypeName, getTypeNamespace, getXercesAttribute, hasAttribute, hasAttributeNS, hasAttributes, isDerivedFrom, isEqualNode, normalize, reconcileDefaultAttributes, removeAttribute, removeAttributeNS, removeAttributeNode, setAttribute, setAttributeNS, setAttributeNode, setAttributeNodeNS, setIdAttribute, setIdAttributeNS, setIdAttributeNode, setOwnerDocument, setReadOnly, setXercesAttributeNode, setupDefaultAttributes, synchronizeData

Methods inherited from class org.apache.xerces.dom.ParentNode

cloneNode, getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, hasChildNodes, insertBefore, isEqualNode, item, normalize, removeChild, replaceChild, setOwnerDocument, setReadOnly, setTextContent, synchronizeChildren

Methods inherited from class org.apache.xerces.dom.ChildNode

cloneNode, getNextSibling, getParentNode, getPreviousSibling

Methods inherited from class org.apache.xerces.dom.NodeImpl

addEventListener, appendChild, changed, changes, cloneNode, compareDocumentPosition, compareTreePosition, dispatchEvent, getAttributes, getBaseURI, getChildNodes, getContainer, getFeature, getFirstChild, getLastChild, getLength, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeNumber, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getReadOnly, getTextContent, getUserData, getUserData, getUserDataRecord, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, needsSyncChildren, normalize, removeChild, removeEventListener, replaceChild, setNodeValue, setOwnerDocument, setPrefix, setReadOnly, setTextContent, setUserData, setUserData, synchronizeData, toString

Field Details

localName

protected String localName
DOM2: localName.

namespaceURI

protected String namespaceURI
DOM2: Namespace URI.

Constructor Details

ElementNSImpl

protected ElementNSImpl()

ElementNSImpl

protected ElementNSImpl(CoreDocumentImpl ownerDocument,
                        String value)

ElementNSImpl

protected ElementNSImpl(CoreDocumentImpl ownerDocument,
                        String namespaceURI,
                        String qualifiedName)
            throws org.w3c.dom.DOMException
DOM2: Constructor for Namespace implementation.

ElementNSImpl

protected ElementNSImpl(CoreDocumentImpl ownerDocument,
                        String namespaceURI,
                        String qualifiedName,
                        String localName)
            throws org.w3c.dom.DOMException

Method Details

getBaseURI

public String getBaseURI()
DOM Level 3 WD - Experimental. Retrieve baseURI
Specified by:
getBaseURI in interface org.w3c.dom.Node
Overrides:
getBaseURI in interface ElementImpl

getLocalName

public String getLocalName()
Introduced in DOM Level 2.

Returns the local part of the qualified name of this node.

Specified by:
getLocalName in interface org.w3c.dom.Node
Overrides:
getLocalName in interface NodeImpl
Since:
WD-DOM-Level-2-19990923

getNamespaceURI

public String getNamespaceURI()
Introduced in DOM Level 2.

The namespace URI of this node, or null if it is unspecified.

This is not a computed value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. It is merely the namespace URI given at creation time.

For nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is null.

Specified by:
getNamespaceURI in interface org.w3c.dom.Node
Overrides:
getNamespaceURI in interface NodeImpl
Since:
WD-DOM-Level-2-19990923

getPrefix

public String getPrefix()
Introduced in DOM Level 2.

The namespace prefix of this node, or null if it is unspecified.

For nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is null.

Specified by:
getPrefix in interface org.w3c.dom.Node
Overrides:
getPrefix in interface NodeImpl
Since:
WD-DOM-Level-2-19990923

getTypeName

public String getTypeName()
Specified by:
getTypeName in interface org.w3c.dom.TypeInfo
Overrides:
getTypeName in interface ElementImpl
See Also:
org.w3c.dom.TypeInfo.getTypeName()

getTypeNamespace

public String getTypeNamespace()
Specified by:
getTypeNamespace in interface org.w3c.dom.TypeInfo
Overrides:
getTypeNamespace in interface ElementImpl
See Also:
org.w3c.dom.TypeInfo.getTypeNamespace()

isDerivedFrom

public boolean isDerivedFrom(String typeNamespaceArg,
                             String typeNameArg,
                             int derivationMethod)
Introduced in DOM Level 2.

Checks if a type is derived from another by restriction. See: http://www.w3.org/TR/DOM-Level-3-Core/core.html#TypeInfo-isDerivedFrom

Specified by:
isDerivedFrom in interface org.w3c.dom.TypeInfo
Overrides:
isDerivedFrom in interface ElementImpl
Parameters:
Returns:
boolean True if the type is derived by restriciton for the reference type

setPrefix

public void setPrefix(String prefix)
            throws org.w3c.dom.DOMException
Introduced in DOM Level 2.

Note that setting this attribute changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable.

Specified by:
setPrefix in interface org.w3c.dom.Node
Overrides:
setPrefix in interface NodeImpl
Parameters:
prefix - The namespace prefix of this node, or null(empty string) if it is unspecified.
Throws:
org.w3c.dom.DOMException -
Since:
WD-DOM-Level-2-19990923

setType

public void setType(org.apache.xerces.xs.XSTypeDefinition type)
NON-DOM: setting type used by the DOM parser

setValues

protected void setValues(CoreDocumentImpl ownerDocument,
                         String namespaceURI,
                         String qualifiedName,
                         String localName)
NON-DOM: resets this node and sets specified values for the node
Parameters:
ownerDocument -
namespaceURI -
qualifiedName -
localName -

Copyright B) 1999-2006 The Apache Software Foundation. All Rights Reserved.