jaxp/src/share/classes/org/xml/sax/ext/Attributes2.java
author kvn
Fri, 20 Jun 2008 11:10:05 -0700
changeset 762 1b26adb5fea1
parent 6 7f561c08de6b
permissions -rw-r--r--
6715633: when matching a memory node the adr_type should not change Summary: verify the adr_type of a mach node was not changed Reviewed-by: rasbold, never
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * Copyright 2004-2005 Sun Microsystems, Inc.  All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 * have any questions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
// Attributes2.java - extended Attributes
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
// http://www.saxproject.org
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
// Public Domain: no warranty.
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
// $Id: Attributes2.java,v 1.2 2004/11/03 22:49:07 jsuttor Exp $
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
package org.xml.sax.ext;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
import org.xml.sax.Attributes;
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * SAX2 extension to augment the per-attribute information
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * provided though {@link Attributes}.
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * If an implementation supports this extension, the attributes
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * provided in {@link org.xml.sax.ContentHandler#startElement
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * ContentHandler.startElement() } will implement this interface,
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * and the <em>http://xml.org/sax/features/use-attributes2</em>
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * feature flag will have the value <em>true</em>.
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 * <blockquote>
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * <em>This module, both source code and documentation, is in the
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * </blockquote>
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * <p> XMLReader implementations are not required to support this
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * information, and it is not part of core-only SAX2 distributions.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 * <p>Note that if an attribute was defaulted (<em>!isSpecified()</em>)
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 * it will of necessity also have been declared (<em>isDeclared()</em>)
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 * in the DTD.
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 * Similarly if an attribute's type is anything except CDATA, then it
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 * must have been declared.
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
 * </p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
 * @since SAX 2.0 (extensions 1.1 alpha)
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
 * @author David Brownell
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
public interface Attributes2 extends Attributes
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
{
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
     * Returns false unless the attribute was declared in the DTD.
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
     * This helps distinguish two kinds of attributes that SAX reports
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
     * as CDATA:  ones that were declared (and hence are usually valid),
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
     * and those that were not (and which are never valid).
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
     * @param index The attribute index (zero-based).
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     * @return true if the attribute was declared in the DTD,
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
     *          false otherwise.
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
     * @exception java.lang.ArrayIndexOutOfBoundsException When the
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
     *            supplied index does not identify an attribute.
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
    public boolean isDeclared (int index);
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
     * Returns false unless the attribute was declared in the DTD.
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
     * This helps distinguish two kinds of attributes that SAX reports
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
     * as CDATA:  ones that were declared (and hence are usually valid),
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
     * and those that were not (and which are never valid).
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
     * @param qName The XML qualified (prefixed) name.
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
     * @return true if the attribute was declared in the DTD,
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
     *          false otherwise.
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
     * @exception java.lang.IllegalArgumentException When the
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
     *            supplied name does not identify an attribute.
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
    public boolean isDeclared (String qName);
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
     * Returns false unless the attribute was declared in the DTD.
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
     * This helps distinguish two kinds of attributes that SAX reports
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
     * as CDATA:  ones that were declared (and hence are usually valid),
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
     * and those that were not (and which are never valid).
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
     * <p>Remember that since DTDs do not "understand" namespaces, the
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
     * namespace URI associated with an attribute may not have come from
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
     * the DTD.  The declaration will have applied to the attribute's
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
     * <em>qName</em>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
     * @param uri The Namespace URI, or the empty string if
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
     *        the name has no Namespace URI.
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
     * @param localName The attribute's local name.
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
     * @return true if the attribute was declared in the DTD,
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
     *          false otherwise.
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
     * @exception java.lang.IllegalArgumentException When the
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
     *            supplied names do not identify an attribute.
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
    public boolean isDeclared (String uri, String localName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
     * Returns true unless the attribute value was provided
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
     * by DTD defaulting.
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
     * @param index The attribute index (zero-based).
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
     * @return true if the value was found in the XML text,
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
     *          false if the value was provided by DTD defaulting.
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
     * @exception java.lang.ArrayIndexOutOfBoundsException When the
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
     *            supplied index does not identify an attribute.
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
    public boolean isSpecified (int index);
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
     * Returns true unless the attribute value was provided
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
     * by DTD defaulting.
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
     * <p>Remember that since DTDs do not "understand" namespaces, the
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
     * namespace URI associated with an attribute may not have come from
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
     * the DTD.  The declaration will have applied to the attribute's
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
     * <em>qName</em>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
     * @param uri The Namespace URI, or the empty string if
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
     *        the name has no Namespace URI.
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
     * @param localName The attribute's local name.
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
     * @return true if the value was found in the XML text,
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
     *          false if the value was provided by DTD defaulting.
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
     * @exception java.lang.IllegalArgumentException When the
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
     *            supplied names do not identify an attribute.
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
    public boolean isSpecified (String uri, String localName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
     * Returns true unless the attribute value was provided
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
     * by DTD defaulting.
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
     * @param qName The XML qualified (prefixed) name.
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
     * @return true if the value was found in the XML text,
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
     *          false if the value was provided by DTD defaulting.
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
     * @exception java.lang.IllegalArgumentException When the
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
     *            supplied name does not identify an attribute.
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
    public boolean isSpecified (String qName);
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
}