FileDocCategorySizeDatePackage
ElementDefinitionImpl.javaAPI DocApache Xerces 3.0.13555Fri Sep 14 20:33:54 BST 2007org.apache.xerces.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 447266 2006-09-18 05:57:49Z mrglavas $

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;