/** * Introduced in DOM Level 2. <p> * * Returns the local part of the qualified name of this node. * @since WD-DOM-Level-2-19990923 */ public String getLocalName() { if (needsSyncData()) { synchronizeData(); } return localName; }
/** * Introduced in DOM Level 2. <p> * * The namespace prefix of this node, or null if it is unspecified. <p> * * For nodes created with a DOM Level 1 method, such as createElement * from the Document interface, this is null. <p> * * @since WD-DOM-Level-2-19990923 */ public String getPrefix() { if (needsSyncData()) { synchronizeData(); } int index = name.indexOf(':'); return index < 0 ? null : name.substring(0, index); }
/** * Introduced in DOM Level 2. <p> * * The namespace URI of this node, or null if it is unspecified.<p> * * 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.<p> * * 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 */ public String getNamespaceURI() { if (needsSyncData()) { synchronizeData(); } // REVIST: This code could/should be done at a lower-level, such that // the namespaceURI is set properly upon creation. However, there still // seems to be some DOM spec interpretation grey-area. return namespaceURI; }
void rename(String namespaceURI, String qualifiedName) { if (needsSyncData()) { synchronizeData(); } this.name = qualifiedName; setName(namespaceURI, qualifiedName); }