FileDocCategorySizeDatePackage
StrictElement.javaAPI DocphoneME MR2 API (J2ME)4440Wed May 02 18:00:36 BST 2007com.sun.perseus.model

StrictElement

public class StrictElement extends ElementNode
The purpose of the StrictElement class is to have a way to create elements with a list of required attributes but no specific rendering behavior.
version
$Id: StrictElement.java,v 1.2 2006/04/21 06:38:49 st125089 Exp $

Fields Summary
String[]
requiredTraits
The set of required traits in the per-element partition namespace.
String[]
requiredTraitsNS
The set of required namespaced traits.
String
localName
This node's local name.
String
namespaceURI
This node's namespace URI
Constructors Summary
public StrictElement(DocumentNode doc, String localName, String namespaceURI, String[] requiredTraits, String[] requiredTraitsNS)
Constructs a new StrictElement with the requested list of required attributes.

param
doc the owner document.
param
localName the element's local name.
param
namespaceURI the element's namespace uri.
param
requiredTraits the list of required traits for the per-element partition namespace.
param
requiredTraitsNS the list of required namespaced traits.

        super(doc);

        if (localName == null) {
            throw new IllegalArgumentException();
        }
        
        this.localName = localName;
        this.namespaceURI = namespaceURI;
        this.requiredTraitsNS = requiredTraitsNS;
        this.requiredTraits = requiredTraits;
    
Methods Summary
public java.lang.StringgetLocalName()

return
unprefixed node name. For an SVGElement, this returns the tag name without a prefix. In case of the Document node, string #document is returned.
throws
SecurityException if the application does not have the necessary privilege rights to access this (SVG) content.

        return localName;
    
public java.lang.StringgetNamespaceURI()

return
the namespace URI of the Node.
throws
SecurityException if the application does not have the necessary privilege rights to access this (SVG) content.

        return namespaceURI;
    
public java.lang.String[]getRequiredTraits()

return
an array of traits that are required by this element.

        return requiredTraits;
    
public java.lang.String[][]getRequiredTraitsNS()

return
an array of namespaceURI, localName trait pairs required by this element.

        return requiredTraitsNS;
    
public ElementNodenewInstance(DocumentNode doc)
Used by DocumentNode to create a new instance from a prototype StrictElement.

param
doc the DocumentNode for which a new node is should be created.
return
a new StrictElement for the requested document.

        return new StrictElement(doc, 
                                 localName, 
                                 namespaceURI, 
                                 requiredTraits, 
                                 requiredTraitsNS);