286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 2000-2002,2004 The Apache Software Foundation. 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A * AttributeMap inherits from NamedNodeMapImpl and extends it to deal with the 286N/A * specifics of storing attributes. These are: 286N/A * <li>managing ownership of attribute nodes 286N/A * <li>managing default attributes 286N/A * <li>firing mutation events 286N/A * This class doesn't directly support mutation events, however, it notifies 286N/A * the document when mutations are performed so that the document class do so. 286N/A /** Serialization version. */ 286N/A /** Constructs a named node map. */ 286N/A // initialize map with the defaults 286N/A * Adds an attribute using its nodeName attribute. 286N/A * @see org.w3c.dom.NamedNodeMap#setNamedItem 286N/A * @return If the new Node replaces an existing node the replaced Node is 286N/A * returned, otherwise null is returned. 286N/A * An Attr node to store in this map. 286N/A * @exception org.w3c.dom.DOMException The exception description. 286N/A // replacing an Attribute with itself does nothing 286N/A // make sure it won't be mistaken with defaults in case it's reused 286N/A i = -
1 - i;
// Insert point (may be end of list) 286N/A // If the new attribute is not normalized, 286N/A // the owning element is inherently not normalized. 286N/A }
// setNamedItem(Node):Node 286N/A * Adds an attribute using its namespaceURI and localName. 286N/A * @see org.w3c.dom.NamedNodeMap#setNamedItem 286N/A * @return If the new Node replaces an existing node the replaced Node is 286N/A * returned, otherwise null is returned. 286N/A * @param arg A node to store in a named node map. 286N/A // replacing an Attribute with itself does nothing 286N/A // make sure it won't be mistaken with defaults in case it's reused 286N/A // If we can't find by namespaceURI, localName, then we find by 286N/A // nodeName so we know where to insert. 286N/A i = -
1 - i;
// Insert point (may be end of list) 286N/A // If the new attribute is not normalized, 286N/A // the owning element is inherently not normalized. 286N/A }
// setNamedItemNS(Node):Node 286N/A * Removes an attribute specified by name. 286N/A * The name of a node to remove. If the 286N/A * removed attribute is known to have a default value, an 286N/A * attribute immediately appears containing the default value 286N/A * as well as the corresponding namespace URI, local name, 286N/A * and prefix when applicable. 286N/A * @return The node removed from the map if a node with such a name exists. 286N/A * @throws NOT_FOUND_ERR: Raised if there is no node named 286N/A * Same as removeNamedItem except that it simply returns null if the 286N/A * specified name is not found. 286N/A * NON-DOM: Remove the node object 286N/A * NOTE: Specifically removes THIS NODE -- not the node with this 286N/A * name, nor the node with these contents. If node does not belong to 286N/A * this named node map, we throw a DOMException. 286N/A * @param item The node to remove 286N/A * @param addDefault true -- magically add default attribute 286N/A * @exception DOMException 286N/A * Internal removeNamedItem method allowing to specify whether an exception 286N/A * must be thrown if the specified name is not found. 286N/A }
// internalRemoveNamedItem(String,boolean):Node 286N/A // If there's a default, add it instead 286N/A // we must rely on the name to find a default attribute 286N/A // ("test:attr"), but while copying it from the DOCTYPE 286N/A // we should not loose namespace URI that was assigned 286N/A // to the attribute in the instance document. 286N/A // remove reference to owner 286N/A // make sure it won't be mistaken with defaults in case it's 286N/A * Introduced in DOM Level 2. <p> 286N/A * Removes an attribute specified by local name and namespace URI. 286N/A * The namespace URI of the node to remove. 286N/A * When it is null or an empty string, this 286N/A * method behaves like removeNamedItem. 286N/A * @param name The local name of the node to remove. If the 286N/A * removed attribute is known to have a default 286N/A * value, an attribute immediately appears 286N/A * containing the default value. 286N/A * @return Node The node removed from the map if a node with such 286N/A * a local name and namespace URI exists. 286N/A * @throws NOT_FOUND_ERR: Raised if there is no node named 286N/A * Same as removeNamedItem except that it simply returns null if the 286N/A * specified local name and namespace URI is not found. 286N/A * Internal removeNamedItemNS method allowing to specify whether an 286N/A * exception must be thrown if the specified local name and namespace URI 286N/A // If there's a default, add it instead 286N/A // we must rely on the name to find a default attribute 286N/A // ("test:attr"), but while copying it from the DOCTYPE 286N/A // we should not loose namespace URI that was assigned 286N/A // to the attribute in the instance document. 286N/A // remove reference to owner 286N/A // make sure it won't be mistaken with defaults in case it's 286N/A // update id table if needed 286N/A }
// internalRemoveNamedItemNS(String,String,boolean):Node 286N/A * Cloning a NamedNodeMap is a DEEP OPERATION; it always clones 286N/A * all the nodes contained in the map. 286N/A }
// cloneMap():AttributeMap 286N/A * Override parent's method to set the ownerNode correctly 286N/A }
// cloneContent():AttributeMap 286N/A * Move specified attributes from the given map to this one 286N/A }
// moveSpecifiedAttributes(AttributeMap):void 286N/A * Get this AttributeMap in sync with the given "defaults" map. 286N/A * @param defaults The default attributes map to sync with. 286N/A // remove any existing default 286N/A // add the new defaults 286N/A }
// reconcileDefaults() 286N/A // If we can't find by namespaceURI, localName, then we find by 286N/A // nodeName so we know where to insert. 286N/A i = -
1 - i;
// Insert point (may be end of list)