FileDocCategorySizeDatePackage
ElementDefinitionImpl.javaAPI DocJava SE 6 API3287Tue Jun 10 00:22:36 BST 2008com.sun.org.apache.xerces.internal.dom

ElementDefinitionImpl

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.

xerces.internal
version
$Id: ElementDefinitionImpl.java,v 1.2.6.1 2005/08/31 11:15:26 sunithareddy Exp $

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


    //
    // Constructors
    //

       
         
    	super(ownerDocument);
        this.name = 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.

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


        if (needsSyncChildren()) {
            synchronizeChildren();
        }
    	return attributes;

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

        if (needsSyncData()) {
            synchronizeData();
        }
        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;