286N/A * Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved. 286N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 286N/A * This code is free software; you can redistribute it and/or modify it 286N/A * under the terms of the GNU General Public License version 2 only, as 286N/A * published by the Free Software Foundation. Oracle designates this 286N/A * particular file as subject to the "Classpath" exception as provided 286N/A * by Oracle in the LICENSE file that accompanied this code. 286N/A * This code is distributed in the hope that it will be useful, but WITHOUT 286N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 286N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 286N/A * version 2 for more details (a copy is included in the LICENSE file that 286N/A * accompanied this code). 286N/A * You should have received a copy of the GNU General Public License version 286N/A * 2 along with this work; if not, write to the Free Software Foundation, 286N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 286N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 286N/A * or visit www.oracle.com if you need additional information or have any 286N/A// Public Domain: no warranty. 286N/A * SAX2 extension helper for additional Attributes information, 286N/A * implementing the {@link Attributes2} interface. 286N/A * <em>This module, both source code and documentation, is in the 286N/A * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em> 286N/A * <p>This is not part of core-only SAX2 distributions.</p> 286N/A * <p>The <em>specified</em> flag for each attribute will always 286N/A * be true, unless it has been set to false in the copy constructor 286N/A * or using {@link #setSpecified}. 286N/A * Similarly, the <em>declared</em> flag for each attribute will 286N/A * always be false, except for defaulted attributes (<em>specified</em> 286N/A * is false), non-CDATA attributes, or when it is set to true using 286N/A * {@link #setDeclared}. 286N/A * If you change an attribute's type by hand, you may need to modify 286N/A * its <em>declared</em> flag to match. 286N/A * @since SAX 2.0 (extensions 1.1 alpha) 286N/A * @author David Brownell 286N/A * Construct a new, empty Attributes2Impl object. 286N/A * Copy an existing Attributes or Attributes2 object. 286N/A * If the object implements Attributes2, values of the 286N/A * <em>specified</em> and <em>declared</em> flags for each 286N/A * attribute are copied. 286N/A * Otherwise the flag values are defaulted to assume no DTD was used, 286N/A * unless there is evidence to the contrary (such as attributes with 286N/A * type other than CDATA, which must have been <em>declared</em>). 286N/A * <p>This constructor is especially useful inside a 286N/A * {@link org.xml.sax.ContentHandler#startElement startElement} event.</p> 286N/A * @param atts The existing Attributes object. 286N/A //////////////////////////////////////////////////////////////////// 286N/A // Implementation of Attributes2 286N/A //////////////////////////////////////////////////////////////////// 286N/A * Returns the current value of the attribute's "declared" flag. 286N/A // javadoc mostly from interface 286N/A * Returns the current value of the attribute's "declared" flag. 286N/A // javadoc mostly from interface 286N/A * Returns the current value of the attribute's "declared" flag. 286N/A // javadoc mostly from interface 286N/A * Returns the current value of an attribute's "specified" flag. 286N/A * @param index The attribute index (zero-based). 286N/A * @return current flag value 286N/A * @exception java.lang.ArrayIndexOutOfBoundsException When the 286N/A * supplied index does not identify an attribute. 286N/A * Returns the current value of an attribute's "specified" flag. 286N/A * @param uri The Namespace URI, or the empty string if 286N/A * the name has no Namespace URI. 286N/A * @param localName The attribute's local name. 286N/A * @return current flag value 286N/A * @exception java.lang.IllegalArgumentException When the 286N/A * supplied names do not identify an attribute. 286N/A * Returns the current value of an attribute's "specified" flag. 286N/A * @param qName The XML qualified (prefixed) name. 286N/A * @return current flag value 286N/A * @exception java.lang.IllegalArgumentException When the 286N/A * supplied name does not identify an attribute. 286N/A //////////////////////////////////////////////////////////////////// 286N/A //////////////////////////////////////////////////////////////////// 286N/A * Copy an entire Attributes object. The "specified" flags are 286N/A * assigned as true, and "declared" flags as false (except when 286N/A * an attribute's type is not CDATA), 286N/A * unless the object is an Attributes2 object. 286N/A * In that case those flag values are all copied. 286N/A * @see AttributesImpl#setAttributes 286N/A * Add an attribute to the end of the list, setting its 286N/A * "specified" flag to true. To set that flag's value 286N/A * to false, use {@link #setSpecified}. 286N/A * <p>Unless the attribute <em>type</em> is CDATA, this attribute 286N/A * is marked as being declared in the DTD. To set that flag's value 286N/A * to true for CDATA attributes, use {@link #setDeclared}. 286N/A * @see AttributesImpl#addAttribute 286N/A // javadoc entirely from superclass 286N/A * Assign a value to the "declared" flag of a specific attribute. 286N/A * This is normally needed only for attributes of type CDATA, 286N/A * including attributes whose type is changed to or from CDATA. 286N/A * @param index The index of the attribute (zero-based). 286N/A * @param value The desired flag value. 286N/A * @exception java.lang.ArrayIndexOutOfBoundsException When the 286N/A * supplied index does not identify an attribute. 286N/A * Assign a value to the "specified" flag of a specific attribute. 286N/A * This is the only way this flag can be cleared, except clearing 286N/A * by initialization with the copy constructor. 286N/A * @param index The index of the attribute (zero-based). 286N/A * @param value The desired flag value. 286N/A * @exception java.lang.ArrayIndexOutOfBoundsException When the 286N/A * supplied index does not identify an attribute.