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

public Class ElementNSImpl

extends ElementImpl
Class Inheritance
Known Direct Subclasses
org.apache.xerces.dom.PSVIElementNSImpl, org.apache.xerces.dom.DeferredElementNSImpl
Imports
org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl, org.apache.xerces.impl.xs.XSComplexTypeDecl, org.apache.xerces.xni.NamespaceContext, org.apache.xerces.xs.XSTypeDefinition, org.w3c.dom.Attr, .DOMException

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.

Authors
Elena litani, IBM, Neeraj Bajaj, Sun Microsystems
Version
$Id: ElementNSImpl.java 924245 2010-03-17 11:58:14Z mrglavas $

Field Summary

Modifier and TypeField and Description
protected String
localName

DOM2: localName.

protected String
namespaceURI

DOM2: Namespace URI.

pack-priv static final long
pack-priv transient XSTypeDefinition
type

DOM3: type information

pack-priv static final String
Inherited from org.apache.xerces.dom.ElementImpl:
attributesname

Constructor Summary

AccessConstructor and Description
protected
protected
ElementNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI, String qualifiedName)

DOM2: Constructor for Namespace implementation.

protected
ElementNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI, String qualifiedName, String localName)

protected
ElementNSImpl(CoreDocumentImpl ownerDocument, String value)

Method Summary

Modifier and TypeMethod and Description
public String
public String
public String
getPrefix()

Overrides org.apache.xerces.dom.NodeImpl.getPrefix.

Implements org.w3c.dom.Node.getPrefix.

Introduced in DOM Level 2.
public String
getTypeName()

Overrides org.apache.xerces.dom.ElementImpl.getTypeName.

Implements org.w3c.dom.TypeInfo.getTypeName.

The name of a type declared for the associated element or attribute, or null if unknown.
public String
getTypeNamespace()

Overrides org.apache.xerces.dom.ElementImpl.getTypeNamespace.

Implements org.w3c.dom.TypeInfo.getTypeNamespace.

The namespace of the type declared for the associated element or attribute or null if the element does not have declaration or if no namespace information is available.
protected Attr
getXMLBaseAttribute()

Overrides org.apache.xerces.dom.ElementImpl.getXMLBaseAttribute.

NON-DOM Returns the xml:base attribute.
public boolean

Returns:

boolean True if the type is derived by restriciton for the reference type
isDerivedFrom
(String
The namspace of the ancestor type declaration
typeNamespaceArg
,
String
The name of the ancestor type declaration
typeNameArg
,
int
The derivation method
derivationMethod
)

Overrides org.apache.xerces.dom.ElementImpl.isDerivedFrom.

Implements org.w3c.dom.TypeInfo.isDerivedFrom.

Introduced in DOM Level 2.
pack-priv void
rename(String namespaceURI, String qualifiedName)

private void
setName(String namespaceURI, String qname)

public void
setPrefix(String
The namespace prefix of this node, or null(empty string) if it is unspecified.
prefix
)

Overrides org.apache.xerces.dom.NodeImpl.setPrefix.

Implements org.w3c.dom.Node.setPrefix.

Introduced in DOM Level 2.
public void
setType(XSTypeDefinition type)

NON-DOM: setting type used by the DOM parser

Inherited from org.apache.xerces.dom.ElementImpl:
cloneNodegetAttributegetAttributeNodegetAttributeNodeNSgetAttributeNSgetAttributesgetBaseURIgetChildElementCountgetDefaultAttributesgetElementsByTagNamegetElementsByTagNameNSgetFirstElementChildgetLastElementChildgetNextElementSiblinggetNodeNamegetNodeTypegetPreviousElementSiblinggetSchemaTypeInfogetTagNamegetXercesAttributehasAttributehasAttributeNShasAttributesisEqualNodemoveSpecifiedAttributesnormalizereconcileDefaultAttributesremoveAttributeremoveAttributeNoderemoveAttributeNSrenamesetAttributesetAttributeNodesetAttributeNodeNSsetAttributeNSsetIdAttributesetIdAttributeNodesetIdAttributeNSsetOwnerDocumentsetReadOnlysetupDefaultAttributessetXercesAttributeNodesynchronizeData

Field Detail

localNameback to summary
protected String localName

DOM2: localName.

namespaceURIback to summary
protected String namespaceURI

DOM2: Namespace URI.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

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

Serialization version.

typeback to summary
pack-priv transient XSTypeDefinition type

DOM3: type information

xmlURIback to summary
pack-priv static final String xmlURI

Constructor Detail

ElementNSImplback to summary
protected ElementNSImpl()
ElementNSImplback to summary
protected ElementNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI, String qualifiedName) throws DOMException

DOM2: Constructor for Namespace implementation.

ElementNSImplback to summary
protected ElementNSImpl(CoreDocumentImpl ownerDocument, String namespaceURI, String qualifiedName, String localName) throws DOMException
ElementNSImplback to summary
protected ElementNSImpl(CoreDocumentImpl ownerDocument, String value)

Method Detail

getLocalNameback to summary
public String getLocalName()

Overrides org.apache.xerces.dom.NodeImpl.getLocalName.

Implements org.w3c.dom.Node.getLocalName.

Introduced in DOM Level 2.

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

Since
WD-DOM-Level-2-19990923
getNamespaceURIback to summary
public String getNamespaceURI()

Overrides org.apache.xerces.dom.NodeImpl.getNamespaceURI.

Implements org.w3c.dom.Node.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.

Since
WD-DOM-Level-2-19990923
getPrefixback to summary
public String getPrefix()

Overrides org.apache.xerces.dom.NodeImpl.getPrefix.

Implements org.w3c.dom.Node.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.

Since
WD-DOM-Level-2-19990923
getTypeNameback to summary
public String getTypeName()

Overrides org.apache.xerces.dom.ElementImpl.getTypeName.

Implements org.w3c.dom.TypeInfo.getTypeName.

Doc from org.w3c.dom.TypeInfo.getTypeName.

The name of a type declared for the associated element or attribute, or null if unknown.

See Also
org.w3c.dom.TypeInfo#getTypeName()
getTypeNamespaceback to summary
public String getTypeNamespace()

Overrides org.apache.xerces.dom.ElementImpl.getTypeNamespace.

Implements org.w3c.dom.TypeInfo.getTypeNamespace.

Doc from org.w3c.dom.TypeInfo.getTypeNamespace.

The namespace of the type declared for the associated element or attribute or null if the element does not have declaration or if no namespace information is available.

See Also
org.w3c.dom.TypeInfo#getTypeNamespace()
getXMLBaseAttributeback to summary
protected Attr getXMLBaseAttribute()

Overrides org.apache.xerces.dom.ElementImpl.getXMLBaseAttribute.

NON-DOM Returns the xml:base attribute.

isDerivedFromback to summary
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)

Overrides org.apache.xerces.dom.ElementImpl.isDerivedFrom.

Implements org.w3c.dom.TypeInfo.isDerivedFrom.

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

Parameters
typeNamespaceArg:String

The namspace of the ancestor type declaration

typeNameArg:String

The name of the ancestor type declaration

derivationMethod:int

The derivation method

Returns:boolean

boolean True if the type is derived by restriciton for the reference type

renameback to summary
pack-priv void rename(String namespaceURI, String qualifiedName)
setNameback to summary
private void setName(String namespaceURI, String qname)
setPrefixback to summary
public void setPrefix(String prefix) throws DOMException

Overrides org.apache.xerces.dom.NodeImpl.setPrefix.

Implements org.w3c.dom.Node.setPrefix.

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.

Parameters
prefix:String

The namespace prefix of this node, or null(empty string) if it is unspecified.

Exceptions
DOMException:

Doc from org.w3c.dom.Node.setPrefix.

INVALID_CHARACTER_ERR: Raised if the specified prefix contains an illegal character 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 specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is null, if the specified prefix is "xml" and the namespaceURI of this node is different from " http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns" [XML Namespaces] .

INVALID_CHARACTER_ERR:
Raised if the specified prefix contains an invalid character.
Since
WD-DOM-Level-2-19990923
setTypeback to summary
public void setType(XSTypeDefinition type)

NON-DOM: setting type used by the DOM parser

See Also
NodeImpl#setReadOnly