jaxp/src/share/classes/org/xml/sax/ContentHandler.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 2000-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
// ContentHandler.java - handle main document content.
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
// http://www.saxproject.org
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
// Written by David Megginson
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
// NO WARRANTY!  This class is in the public domain.
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
// $Id: ContentHandler.java,v 1.2 2004/11/03 22:44:51 jsuttor Exp $
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
package org.xml.sax;
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * Receive notification of the logical content of a document.
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * <blockquote>
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * <em>This module, both source code and documentation, is in the
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * for further information.
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * </blockquote>
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 * <p>This is the main interface that most SAX applications
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * implement: if the application needs to be informed of basic parsing
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * events, it implements this interface and registers an instance with
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * the SAX parser using the {@link org.xml.sax.XMLReader#setContentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 * setContentHandler} method.  The parser uses the instance to report
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * basic document-related events like the start and end of elements
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * and character data.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 * <p>The order of events in this interface is very important, and
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 * mirrors the order of information in the document itself.  For
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 * example, all of an element's content (character data, processing
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 * instructions, and/or subelements) will appear, in order, between
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 * the startElement event and the corresponding endElement event.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
 * <p>This interface is similar to the now-deprecated SAX 1.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
 * DocumentHandler interface, but it adds support for Namespaces
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
 * and for reporting skipped entities (in non-validating XML
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
 * processors).</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
 * <p>Implementors should note that there is also a
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
 * <code>ContentHandler</code> class in the <code>java.net</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
 * package; that means that it's probably a bad idea to do</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
 * <pre>import java.net.*;
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
 * import org.xml.sax.*;
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
 * </pre>
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
 * <p>In fact, "import ...*" is usually a sign of sloppy programming
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
 * anyway, so the user should consider this a feature rather than a
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
 * bug.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
 * @since SAX 2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
 * @author David Megginson
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
 * @see org.xml.sax.XMLReader
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
 * @see org.xml.sax.DTDHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
 * @see org.xml.sax.ErrorHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
public interface ContentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
{
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
     * Receive an object for locating the origin of SAX document events.
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
     * <p>SAX parsers are strongly encouraged (though not absolutely
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
     * required) to supply a locator: if it does so, it must supply
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
     * the locator to the application by invoking this method before
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
     * invoking any of the other methods in the ContentHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
     * interface.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
     * <p>The locator allows the application to determine the end
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
     * position of any document-related event, even if the parser is
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
     * not reporting an error.  Typically, the application will
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
     * use this information for reporting its own errors (such as
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
     * character content that does not match an application's
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
     * business rules).  The information returned by the locator
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
     * is probably not sufficient for use with a search engine.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
     * <p>Note that the locator will return correct information only
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
     * during the invocation SAX event callbacks after
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
     * {@link #startDocument startDocument} returns and before
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
     * {@link #endDocument endDocument} is called.  The
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
     * application should not attempt to use it at any other time.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
     * @param locator an object that can return the location of
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
     *                any SAX document event
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
     * @see org.xml.sax.Locator
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
    public void setDocumentLocator (Locator locator);
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
     * Receive notification of the beginning of a document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
     * <p>The SAX parser will invoke this method only once, before any
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
     * other event callbacks (except for {@link #setDocumentLocator
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
     * setDocumentLocator}).</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
     * @throws org.xml.sax.SAXException any SAX exception, possibly
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
     *            wrapping another exception
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
     * @see #endDocument
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
    public void startDocument ()
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
     * Receive notification of the end of a document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
     * <p><strong>There is an apparent contradiction between the
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
     * documentation for this method and the documentation for {@link
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
     * org.xml.sax.ErrorHandler#fatalError}.  Until this ambiguity is
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
     * resolved in a future major release, clients should make no
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
     * assumptions about whether endDocument() will or will not be
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
     * invoked when the parser has reported a fatalError() or thrown
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
     * an exception.</strong></p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
     * <p>The SAX parser will invoke this method only once, and it will
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
     * be the last method invoked during the parse.  The parser shall
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
     * not invoke this method until it has either abandoned parsing
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
     * (because of an unrecoverable error) or reached the end of
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
     * input.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
     * @throws org.xml.sax.SAXException any SAX exception, possibly
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
     *            wrapping another exception
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
     * @see #startDocument
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
    public void endDocument()
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
     * Begin the scope of a prefix-URI Namespace mapping.
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
     * <p>The information from this event is not necessary for
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
     * normal Namespace processing: the SAX XML reader will
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
     * automatically replace prefixes for element and attribute
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
     * names when the <code>http://xml.org/sax/features/namespaces</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
     * feature is <var>true</var> (the default).</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
     * <p>There are cases, however, when applications need to
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
     * use prefixes in character data or in attribute values,
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
     * where they cannot safely be expanded automatically; the
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
     * start/endPrefixMapping event supplies the information
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
     * to the application to expand prefixes in those contexts
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
     * itself, if necessary.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
     * <p>Note that start/endPrefixMapping events are not
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
     * guaranteed to be properly nested relative to each other:
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
     * all startPrefixMapping events will occur immediately before the
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
     * corresponding {@link #startElement startElement} event,
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
     * and all {@link #endPrefixMapping endPrefixMapping}
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
     * events will occur immediately after the corresponding
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
     * {@link #endElement endElement} event,
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
     * but their order is not otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
     * guaranteed.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
     * <p>There should never be start/endPrefixMapping events for the
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
     * "xml" prefix, since it is predeclared and immutable.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
     * @param prefix the Namespace prefix being declared.
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
     *  An empty string is used for the default element namespace,
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
     *  which has no prefix.
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
     * @param uri the Namespace URI the prefix is mapped to
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
     * @throws org.xml.sax.SAXException the client may throw
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
     *            an exception during processing
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
     * @see #endPrefixMapping
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
     * @see #startElement
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
    public void startPrefixMapping (String prefix, String uri)
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
     * End the scope of a prefix-URI mapping.
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
     * <p>See {@link #startPrefixMapping startPrefixMapping} for
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
     * details.  These events will always occur immediately after the
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
     * corresponding {@link #endElement endElement} event, but the order of
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
     * {@link #endPrefixMapping endPrefixMapping} events is not otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
     * guaranteed.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
     * @param prefix the prefix that was being mapped.
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
     *  This is the empty string when a default mapping scope ends.
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
     * @throws org.xml.sax.SAXException the client may throw
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
     *            an exception during processing
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
     * @see #startPrefixMapping
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
     * @see #endElement
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
    public void endPrefixMapping (String prefix)
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
     * Receive notification of the beginning of an element.
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
     * <p>The Parser will invoke this method at the beginning of every
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
     * element in the XML document; there will be a corresponding
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
     * {@link #endElement endElement} event for every startElement event
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
     * (even when the element is empty). All of the element's content will be
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
     * reported, in order, before the corresponding endElement
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
     * event.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
     * <p>This event allows up to three name components for each
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
     * element:</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
     * <ol>
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
     * <li>the Namespace URI;</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
     * <li>the local name; and</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
     * <li>the qualified (prefixed) name.</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
     * </ol>
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
     * <p>Any or all of these may be provided, depending on the
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
     * values of the <var>http://xml.org/sax/features/namespaces</var>
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
     * and the <var>http://xml.org/sax/features/namespace-prefixes</var>
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
     * properties:</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
     * <ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
     * <li>the Namespace URI and local name are required when
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
     * the namespaces property is <var>true</var> (the default), and are
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
     * optional when the namespaces property is <var>false</var> (if one is
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
     * specified, both must be);</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
     * <li>the qualified name is required when the namespace-prefixes property
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
     * is <var>true</var>, and is optional when the namespace-prefixes property
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
     * is <var>false</var> (the default).</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
     * </ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
     * <p>Note that the attribute list provided will contain only
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
     * attributes with explicit values (specified or defaulted):
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
     * #IMPLIED attributes will be omitted.  The attribute list
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
     * will contain attributes used for Namespace declarations
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
     * (xmlns* attributes) only if the
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
     * <code>http://xml.org/sax/features/namespace-prefixes</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
     * property is true (it is false by default, and support for a
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
     * true value is optional).</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
     * <p>Like {@link #characters characters()}, attribute values may have
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
     * characters that need more than one <code>char</code> value.  </p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
     * @param uri the Namespace URI, or the empty string if the
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
     *        element has no Namespace URI or if Namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
     *        processing is not being performed
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
     * @param localName the local name (without prefix), or the
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
     *        empty string if Namespace processing is not being
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
     *        performed
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
     * @param qName the qualified name (with prefix), or the
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
     *        empty string if qualified names are not available
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
     * @param atts the attributes attached to the element.  If
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
     *        there are no attributes, it shall be an empty
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
     *        Attributes object.  The value of this object after
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
     *        startElement returns is undefined
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
     * @throws org.xml.sax.SAXException any SAX exception, possibly
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
     *            wrapping another exception
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
     * @see #endElement
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
     * @see org.xml.sax.Attributes
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
     * @see org.xml.sax.helpers.AttributesImpl
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
    public void startElement (String uri, String localName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   282
                              String qName, Attributes atts)
7f561c08de6b Initial load
duke
parents:
diff changeset
   283
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   284
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   287
     * Receive notification of the end of an element.
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
     * <p>The SAX parser will invoke this method at the end of every
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
     * element in the XML document; there will be a corresponding
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
     * {@link #startElement startElement} event for every endElement
7f561c08de6b Initial load
duke
parents:
diff changeset
   292
     * event (even when the element is empty).</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   293
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   294
     * <p>For information on the names, see startElement.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   295
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   296
     * @param uri the Namespace URI, or the empty string if the
7f561c08de6b Initial load
duke
parents:
diff changeset
   297
     *        element has no Namespace URI or if Namespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   298
     *        processing is not being performed
7f561c08de6b Initial load
duke
parents:
diff changeset
   299
     * @param localName the local name (without prefix), or the
7f561c08de6b Initial load
duke
parents:
diff changeset
   300
     *        empty string if Namespace processing is not being
7f561c08de6b Initial load
duke
parents:
diff changeset
   301
     *        performed
7f561c08de6b Initial load
duke
parents:
diff changeset
   302
     * @param qName the qualified XML name (with prefix), or the
7f561c08de6b Initial load
duke
parents:
diff changeset
   303
     *        empty string if qualified names are not available
7f561c08de6b Initial load
duke
parents:
diff changeset
   304
     * @throws org.xml.sax.SAXException any SAX exception, possibly
7f561c08de6b Initial load
duke
parents:
diff changeset
   305
     *            wrapping another exception
7f561c08de6b Initial load
duke
parents:
diff changeset
   306
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   307
    public void endElement (String uri, String localName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   308
                            String qName)
7f561c08de6b Initial load
duke
parents:
diff changeset
   309
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   310
7f561c08de6b Initial load
duke
parents:
diff changeset
   311
7f561c08de6b Initial load
duke
parents:
diff changeset
   312
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   313
     * Receive notification of character data.
7f561c08de6b Initial load
duke
parents:
diff changeset
   314
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   315
     * <p>The Parser will call this method to report each chunk of
7f561c08de6b Initial load
duke
parents:
diff changeset
   316
     * character data.  SAX parsers may return all contiguous character
7f561c08de6b Initial load
duke
parents:
diff changeset
   317
     * data in a single chunk, or they may split it into several
7f561c08de6b Initial load
duke
parents:
diff changeset
   318
     * chunks; however, all of the characters in any single event
7f561c08de6b Initial load
duke
parents:
diff changeset
   319
     * must come from the same external entity so that the Locator
7f561c08de6b Initial load
duke
parents:
diff changeset
   320
     * provides useful information.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   321
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   322
     * <p>The application must not attempt to read from the array
7f561c08de6b Initial load
duke
parents:
diff changeset
   323
     * outside of the specified range.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   324
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   325
     * <p>Individual characters may consist of more than one Java
7f561c08de6b Initial load
duke
parents:
diff changeset
   326
     * <code>char</code> value.  There are two important cases where this
7f561c08de6b Initial load
duke
parents:
diff changeset
   327
     * happens, because characters can't be represented in just sixteen bits.
7f561c08de6b Initial load
duke
parents:
diff changeset
   328
     * In one case, characters are represented in a <em>Surrogate Pair</em>,
7f561c08de6b Initial load
duke
parents:
diff changeset
   329
     * using two special Unicode values. Such characters are in the so-called
7f561c08de6b Initial load
duke
parents:
diff changeset
   330
     * "Astral Planes", with a code point above U+FFFF.  A second case involves
7f561c08de6b Initial load
duke
parents:
diff changeset
   331
     * composite characters, such as a base character combining with one or
7f561c08de6b Initial load
duke
parents:
diff changeset
   332
     * more accent characters. </p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   333
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   334
     * <p> Your code should not assume that algorithms using
7f561c08de6b Initial load
duke
parents:
diff changeset
   335
     * <code>char</code>-at-a-time idioms will be working in character
7f561c08de6b Initial load
duke
parents:
diff changeset
   336
     * units; in some cases they will split characters.  This is relevant
7f561c08de6b Initial load
duke
parents:
diff changeset
   337
     * wherever XML permits arbitrary characters, such as attribute values,
7f561c08de6b Initial load
duke
parents:
diff changeset
   338
     * processing instruction data, and comments as well as in data reported
7f561c08de6b Initial load
duke
parents:
diff changeset
   339
     * from this method.  It's also generally relevant whenever Java code
7f561c08de6b Initial load
duke
parents:
diff changeset
   340
     * manipulates internationalized text; the issue isn't unique to XML.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   341
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   342
     * <p>Note that some parsers will report whitespace in element
7f561c08de6b Initial load
duke
parents:
diff changeset
   343
     * content using the {@link #ignorableWhitespace ignorableWhitespace}
7f561c08de6b Initial load
duke
parents:
diff changeset
   344
     * method rather than this one (validating parsers <em>must</em>
7f561c08de6b Initial load
duke
parents:
diff changeset
   345
     * do so).</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   346
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   347
     * @param ch the characters from the XML document
7f561c08de6b Initial load
duke
parents:
diff changeset
   348
     * @param start the start position in the array
7f561c08de6b Initial load
duke
parents:
diff changeset
   349
     * @param length the number of characters to read from the array
7f561c08de6b Initial load
duke
parents:
diff changeset
   350
     * @throws org.xml.sax.SAXException any SAX exception, possibly
7f561c08de6b Initial load
duke
parents:
diff changeset
   351
     *            wrapping another exception
7f561c08de6b Initial load
duke
parents:
diff changeset
   352
     * @see #ignorableWhitespace
7f561c08de6b Initial load
duke
parents:
diff changeset
   353
     * @see org.xml.sax.Locator
7f561c08de6b Initial load
duke
parents:
diff changeset
   354
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   355
    public void characters (char ch[], int start, int length)
7f561c08de6b Initial load
duke
parents:
diff changeset
   356
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   357
7f561c08de6b Initial load
duke
parents:
diff changeset
   358
7f561c08de6b Initial load
duke
parents:
diff changeset
   359
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   360
     * Receive notification of ignorable whitespace in element content.
7f561c08de6b Initial load
duke
parents:
diff changeset
   361
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   362
     * <p>Validating Parsers must use this method to report each chunk
7f561c08de6b Initial load
duke
parents:
diff changeset
   363
     * of whitespace in element content (see the W3C XML 1.0
7f561c08de6b Initial load
duke
parents:
diff changeset
   364
     * recommendation, section 2.10): non-validating parsers may also
7f561c08de6b Initial load
duke
parents:
diff changeset
   365
     * use this method if they are capable of parsing and using
7f561c08de6b Initial load
duke
parents:
diff changeset
   366
     * content models.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   367
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   368
     * <p>SAX parsers may return all contiguous whitespace in a single
7f561c08de6b Initial load
duke
parents:
diff changeset
   369
     * chunk, or they may split it into several chunks; however, all of
7f561c08de6b Initial load
duke
parents:
diff changeset
   370
     * the characters in any single event must come from the same
7f561c08de6b Initial load
duke
parents:
diff changeset
   371
     * external entity, so that the Locator provides useful
7f561c08de6b Initial load
duke
parents:
diff changeset
   372
     * information.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   373
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   374
     * <p>The application must not attempt to read from the array
7f561c08de6b Initial load
duke
parents:
diff changeset
   375
     * outside of the specified range.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   376
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   377
     * @param ch the characters from the XML document
7f561c08de6b Initial load
duke
parents:
diff changeset
   378
     * @param start the start position in the array
7f561c08de6b Initial load
duke
parents:
diff changeset
   379
     * @param length the number of characters to read from the array
7f561c08de6b Initial load
duke
parents:
diff changeset
   380
     * @throws org.xml.sax.SAXException any SAX exception, possibly
7f561c08de6b Initial load
duke
parents:
diff changeset
   381
     *            wrapping another exception
7f561c08de6b Initial load
duke
parents:
diff changeset
   382
     * @see #characters
7f561c08de6b Initial load
duke
parents:
diff changeset
   383
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   384
    public void ignorableWhitespace (char ch[], int start, int length)
7f561c08de6b Initial load
duke
parents:
diff changeset
   385
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   386
7f561c08de6b Initial load
duke
parents:
diff changeset
   387
7f561c08de6b Initial load
duke
parents:
diff changeset
   388
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   389
     * Receive notification of a processing instruction.
7f561c08de6b Initial load
duke
parents:
diff changeset
   390
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   391
     * <p>The Parser will invoke this method once for each processing
7f561c08de6b Initial load
duke
parents:
diff changeset
   392
     * instruction found: note that processing instructions may occur
7f561c08de6b Initial load
duke
parents:
diff changeset
   393
     * before or after the main document element.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   394
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   395
     * <p>A SAX parser must never report an XML declaration (XML 1.0,
7f561c08de6b Initial load
duke
parents:
diff changeset
   396
     * section 2.8) or a text declaration (XML 1.0, section 4.3.1)
7f561c08de6b Initial load
duke
parents:
diff changeset
   397
     * using this method.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   398
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   399
     * <p>Like {@link #characters characters()}, processing instruction
7f561c08de6b Initial load
duke
parents:
diff changeset
   400
     * data may have characters that need more than one <code>char</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   401
     * value. </p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   402
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   403
     * @param target the processing instruction target
7f561c08de6b Initial load
duke
parents:
diff changeset
   404
     * @param data the processing instruction data, or null if
7f561c08de6b Initial load
duke
parents:
diff changeset
   405
     *        none was supplied.  The data does not include any
7f561c08de6b Initial load
duke
parents:
diff changeset
   406
     *        whitespace separating it from the target
7f561c08de6b Initial load
duke
parents:
diff changeset
   407
     * @throws org.xml.sax.SAXException any SAX exception, possibly
7f561c08de6b Initial load
duke
parents:
diff changeset
   408
     *            wrapping another exception
7f561c08de6b Initial load
duke
parents:
diff changeset
   409
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   410
    public void processingInstruction (String target, String data)
7f561c08de6b Initial load
duke
parents:
diff changeset
   411
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   412
7f561c08de6b Initial load
duke
parents:
diff changeset
   413
7f561c08de6b Initial load
duke
parents:
diff changeset
   414
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   415
     * Receive notification of a skipped entity.
7f561c08de6b Initial load
duke
parents:
diff changeset
   416
     * This is not called for entity references within markup constructs
7f561c08de6b Initial load
duke
parents:
diff changeset
   417
     * such as element start tags or markup declarations.  (The XML
7f561c08de6b Initial load
duke
parents:
diff changeset
   418
     * recommendation requires reporting skipped external entities.
7f561c08de6b Initial load
duke
parents:
diff changeset
   419
     * SAX also reports internal entity expansion/non-expansion, except
7f561c08de6b Initial load
duke
parents:
diff changeset
   420
     * within markup constructs.)
7f561c08de6b Initial load
duke
parents:
diff changeset
   421
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   422
     * <p>The Parser will invoke this method each time the entity is
7f561c08de6b Initial load
duke
parents:
diff changeset
   423
     * skipped.  Non-validating processors may skip entities if they
7f561c08de6b Initial load
duke
parents:
diff changeset
   424
     * have not seen the declarations (because, for example, the
7f561c08de6b Initial load
duke
parents:
diff changeset
   425
     * entity was declared in an external DTD subset).  All processors
7f561c08de6b Initial load
duke
parents:
diff changeset
   426
     * may skip external entities, depending on the values of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   427
     * <code>http://xml.org/sax/features/external-general-entities</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   428
     * and the
7f561c08de6b Initial load
duke
parents:
diff changeset
   429
     * <code>http://xml.org/sax/features/external-parameter-entities</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   430
     * properties.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   431
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   432
     * @param name the name of the skipped entity.  If it is a
7f561c08de6b Initial load
duke
parents:
diff changeset
   433
     *        parameter entity, the name will begin with '%', and if
7f561c08de6b Initial load
duke
parents:
diff changeset
   434
     *        it is the external DTD subset, it will be the string
7f561c08de6b Initial load
duke
parents:
diff changeset
   435
     *        "[dtd]"
7f561c08de6b Initial load
duke
parents:
diff changeset
   436
     * @throws org.xml.sax.SAXException any SAX exception, possibly
7f561c08de6b Initial load
duke
parents:
diff changeset
   437
     *            wrapping another exception
7f561c08de6b Initial load
duke
parents:
diff changeset
   438
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   439
    public void skippedEntity (String name)
7f561c08de6b Initial load
duke
parents:
diff changeset
   440
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   441
}
7f561c08de6b Initial load
duke
parents:
diff changeset
   442
7f561c08de6b Initial load
duke
parents:
diff changeset
   443
// end of ContentHandler.java