ElementDefinitionImpl.javaAPI DocJava SE 6 API3287Tue Jun 10 00:22:36 BST


public class ElementDefinitionImpl extends ParentNode
NON-DOM CLASS: Describe one of the Elements (and its associated Attributes) defined in this Document Type.

I've included this in Level 1 purely as an anchor point for default attributes. In Level 2 it should enable the ChildRule support.

$Id:,v 2005/08/31 11:15:26 sunithareddy Exp $

Fields Summary
static final long
Serialization version.
protected String
Element definition name.
protected NamedNodeMapImpl
Default attributes.
Constructors Summary
public ElementDefinitionImpl(CoreDocumentImpl ownerDocument, String name)
Factory constructor.

    // Constructors

    	super(ownerDocument); = name;
        attributes = new NamedNodeMapImpl(ownerDocument);
Methods Summary
public org.w3c.dom.NodecloneNode(boolean deep)
Replicate this object.

    	ElementDefinitionImpl newnode =
            (ElementDefinitionImpl) super.cloneNode(deep);
    	// NamedNodeMap must be explicitly replicated to avoid sharing
    	newnode.attributes = attributes.cloneMap(newnode);
    	return newnode;

public org.w3c.dom.NamedNodeMapgetAttributes()
Query the attributes defined on this Element.

In the base implementation this Map simply contains Attribute objects representing the defaults. In a more serious implementation, it would contain AttributeDefinitionImpl objects for all declared Attributes, indicating which are Default, DefaultFixed, Implicit and/or Required.

org.w3c.dom.NamedNodeMap containing org.w3c.dom.Attribute

        if (needsSyncChildren()) {
    	return attributes;

public java.lang.StringgetNodeName()
Returns the element definition name

        if (needsSyncData()) {
        return name;
public shortgetNodeType()
A short integer indicating what type of node this is. The named constants for this value are defined in the org.w3c.dom.Node interface.

        return NodeImpl.ELEMENT_DEFINITION_NODE;