jaxp/src/share/classes/org/xml/sax/ext/DeclHandler.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
// DeclHandler.java - Optional handler for DTD declaration events.
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: DeclHandler.java,v 1.2 2004/11/03 22:49:08 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.SAXException;
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 handler for DTD declaration events.
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * <blockquote>
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * <em>This module, both source code and documentation, is in the
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * See <a href='http://www.saxproject.org'>http://www.saxproject.org</a>
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * for further information.
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * </blockquote>
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * <p>This is an optional extension handler for SAX2 to provide more
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * complete information about DTD declarations in an XML document.
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * XML readers are not required to recognize this handler, and it
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 * is not part of core-only SAX2 distributions.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * <p>Note that data-related DTD declarations (unparsed entities and
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 * notations) are already reported through the {@link
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 * org.xml.sax.DTDHandler DTDHandler} interface.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 * <p>If you are using the declaration handler together with a lexical
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 * handler, all of the events will occur between the
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 * {@link org.xml.sax.ext.LexicalHandler#startDTD startDTD} and the
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
 * {@link org.xml.sax.ext.LexicalHandler#endDTD endDTD} events.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
 * <p>To set the DeclHandler for an XML reader, use the
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
 * {@link org.xml.sax.XMLReader#setProperty setProperty} method
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
 * with the property name
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
 * <code>http://xml.org/sax/properties/declaration-handler</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
 * and an object implementing this interface (or null) as the value.
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
 * If the reader does not report declaration events, it will throw a
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
 * {@link org.xml.sax.SAXNotRecognizedException SAXNotRecognizedException}
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
 * when you attempt to register the handler.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
 * @since SAX 2.0 (extensions 1.0)
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
 * @author David Megginson
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
public interface DeclHandler
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
{
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     * Report an element type declaration.
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
     * <p>The content model will consist of the string "EMPTY", the
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
     * string "ANY", or a parenthesised group, optionally followed
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
     * by an occurrence indicator.  The model will be normalized so
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
     * that all parameter entities are fully resolved and all whitespace
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
     * is removed,and will include the enclosing parentheses.  Other
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
     * normalization (such as removing redundant parentheses or
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
     * simplifying occurrence indicators) is at the discretion of the
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
     * parser.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
     * @param name The element type name.
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
     * @param model The content model as a normalized string.
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
     * @exception SAXException The application may raise an exception.
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
    public abstract void elementDecl (String name, String model)
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
     * Report an attribute type declaration.
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
     * <p>Only the effective (first) declaration for an attribute will
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
     * be reported.  The type will be one of the strings "CDATA",
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
     * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY",
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
     * "ENTITIES", a parenthesized token group with
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
     * the separator "|" and all whitespace removed, or the word
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
     * "NOTATION" followed by a space followed by a parenthesized
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
     * token group with all whitespace removed.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
     * <p>The value will be the value as reported to applications,
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
     * appropriately normalized and with entity and character
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
     * references expanded.  </p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
     * @param eName The name of the associated element.
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
     * @param aName The name of the attribute.
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
     * @param type A string representing the attribute type.
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
     * @param mode A string representing the attribute defaulting mode
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
     *        ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
     *        none of these applies.
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
     * @param value A string representing the attribute's default value,
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
     *        or null if there is none.
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
     * @exception SAXException The application may raise an exception.
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
    public abstract void attributeDecl (String eName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
                                        String aName,
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
                                        String type,
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
                                        String mode,
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
                                        String value)
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
     * Report an internal entity declaration.
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
     * <p>Only the effective (first) declaration for each entity
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
     * will be reported.  All parameter entities in the value
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
     * will be expanded, but general entities will not.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
     * @param name The name of the entity.  If it is a parameter
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
     *        entity, the name will begin with '%'.
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
     * @param value The replacement text of the entity.
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
     * @exception SAXException The application may raise an exception.
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
     * @see #externalEntityDecl
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
     * @see org.xml.sax.DTDHandler#unparsedEntityDecl
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
    public abstract void internalEntityDecl (String name, String value)
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
     * Report a parsed external entity declaration.
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
     * <p>Only the effective (first) declaration for each entity
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
     * will be reported.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
     * <p>If the system identifier is a URL, the parser must resolve it
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
     * fully before passing it to the application.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
     * @param name The name of the entity.  If it is a parameter
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
     *        entity, the name will begin with '%'.
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
     * @param publicId The entity's public identifier, or null if none
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
     *        was given.
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
     * @param systemId The entity's system identifier.
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
     * @exception SAXException The application may raise an exception.
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
     * @see #internalEntityDecl
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
     * @see org.xml.sax.DTDHandler#unparsedEntityDecl
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
    public abstract void externalEntityDecl (String name, String publicId,
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
                                             String systemId)
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
        throws SAXException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
}
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
// end of DeclHandler.java