jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java
author joehw
Thu, 12 Apr 2012 08:38:26 -0700
changeset 12457 c348e06f0e82
parent 12005 jaxp/src/share/classes/com/sun/org/apache/xerces/internal/impl/XMLNamespaceBinder.java@a754d69d5e60
child 25264 040625ce9b72
permissions -rw-r--r--
7160496: Rename JDK8 JAXP source directory Summary: moving src/share/classes to src Reviewed-by: ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     1
/*
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     2
 * reserved comment block
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     4
 */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     5
/*
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     6
 * The Apache Software License, Version 1.1
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     7
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     8
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     9
 * Copyright (c) 2000-2002 The Apache Software Foundation.  All rights
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    10
 * reserved.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    11
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    12
 * Redistribution and use in source and binary forms, with or without
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    13
 * modification, are permitted provided that the following conditions
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    14
 * are met:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    15
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    16
 * 1. Redistributions of source code must retain the above copyright
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    17
 *    notice, this list of conditions and the following disclaimer.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    18
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    19
 * 2. Redistributions in binary form must reproduce the above copyright
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    20
 *    notice, this list of conditions and the following disclaimer in
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    21
 *    the documentation and/or other materials provided with the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    22
 *    distribution.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    23
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    24
 * 3. The end-user documentation included with the redistribution,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    25
 *    if any, must include the following acknowledgment:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    26
 *       "This product includes software developed by the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    27
 *        Apache Software Foundation (http://www.apache.org/)."
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    28
 *    Alternately, this acknowledgment may appear in the software itself,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    29
 *    if and wherever such third-party acknowledgments normally appear.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    30
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    31
 * 4. The names "Xerces" and "Apache Software Foundation" must
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    32
 *    not be used to endorse or promote products derived from this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    33
 *    software without prior written permission. For written
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    34
 *    permission, please contact apache@apache.org.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    35
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    36
 * 5. Products derived from this software may not be called "Apache",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    37
 *    nor may "Apache" appear in their name, without prior written
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    38
 *    permission of the Apache Software Foundation.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    39
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    40
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    41
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    42
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    43
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    44
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    45
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    46
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    47
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    48
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    49
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    50
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    51
 * SUCH DAMAGE.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    52
 * ====================================================================
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    53
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    54
 * This software consists of voluntary contributions made by many
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    55
 * individuals on behalf of the Apache Software Foundation and was
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    56
 * originally based on software copyright (c) 1999, International
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    57
 * Business Machines, Inc., http://www.apache.org.  For more
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    58
 * information on the Apache Software Foundation, please see
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    59
 * <http://www.apache.org/>.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    60
 */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    61
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    62
package com.sun.org.apache.xerces.internal.impl;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    63
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    64
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    65
import com.sun.org.apache.xerces.internal.util.SymbolTable;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    66
import com.sun.org.apache.xerces.internal.util.XMLSymbols;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    67
import com.sun.org.apache.xerces.internal.xni.Augmentations;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    68
import com.sun.org.apache.xerces.internal.xni.NamespaceContext;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    69
import com.sun.org.apache.xerces.internal.xni.QName;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    70
import com.sun.org.apache.xerces.internal.xni.XMLAttributes;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    71
import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    72
import com.sun.org.apache.xerces.internal.xni.XMLLocator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    73
import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    74
import com.sun.org.apache.xerces.internal.xni.XMLString;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    75
import com.sun.org.apache.xerces.internal.xni.XNIException;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    76
import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    77
import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    78
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    79
import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    80
import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    81
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    82
/**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    83
 * This class performs namespace binding on the startElement and endElement
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    84
 * method calls and passes all other methods through to the registered
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    85
 * document handler. This class can be configured to only pass the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    86
 * start and end prefix mappings (start/endPrefixMapping).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    87
 * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    88
 * This component requires the following features and properties from the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    89
 * component manager that uses it:
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    90
 * <ul>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    91
 *  <li>http://xml.org/sax/features/namespaces</li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    92
 *  <li>http://apache.org/xml/properties/internal/symbol-table</li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    93
 *  <li>http://apache.org/xml/properties/internal/error-reporter</li>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    94
 * </ul>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    95
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    96
 * @xerces.internal
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    97
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    98
 * @author Andy Clark, IBM
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    99
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   100
 * @version $Id: XMLNamespaceBinder.java,v 1.4 2010-11-01 04:39:41 joehw Exp $
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   101
 */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   102
public class XMLNamespaceBinder
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   103
    implements XMLComponent, XMLDocumentFilter {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   104
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   105
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   106
    // Constants
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   107
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   108
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   109
    // feature identifiers
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   110
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   111
    /** Feature identifier: namespaces. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   112
    protected static final String NAMESPACES =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   113
        Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   114
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   115
    // property identifiers
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   116
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   117
    /** Property identifier: symbol table. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   118
    protected static final String SYMBOL_TABLE =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   119
        Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   120
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   121
    /** Property identifier: error reporter. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   122
    protected static final String ERROR_REPORTER =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   123
        Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   124
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   125
    // recognized features and properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   126
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   127
    /** Recognized features. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   128
    private static final String[] RECOGNIZED_FEATURES = {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   129
        NAMESPACES,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   130
    };
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   131
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   132
    /** Feature defaults. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   133
    private static final Boolean[] FEATURE_DEFAULTS = {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   134
        null,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   135
    };
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   136
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   137
    /** Recognized properties. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   138
    private static final String[] RECOGNIZED_PROPERTIES = {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   139
        SYMBOL_TABLE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   140
        ERROR_REPORTER,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   141
    };
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   142
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   143
    /** Property defaults. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   144
    private static final Object[] PROPERTY_DEFAULTS = {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   145
        null,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   146
        null,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   147
    };
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   148
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   149
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   150
    // Data
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   151
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   152
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   153
    // features
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   154
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   155
    /** Namespaces. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   156
    protected boolean fNamespaces;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   157
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   158
    // properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   159
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   160
    /** Symbol table. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   161
    protected SymbolTable fSymbolTable;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   162
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   163
    /** Error reporter. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   164
    protected XMLErrorReporter fErrorReporter;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   165
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   166
    // handlers
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   167
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   168
    /** Document handler. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   169
    protected XMLDocumentHandler fDocumentHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   170
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   171
    protected XMLDocumentSource fDocumentSource;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   172
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   173
    // settings
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   174
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   175
    /** Only pass start and end prefix mapping events. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   176
    protected boolean fOnlyPassPrefixMappingEvents;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   177
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   178
    // shared context
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   179
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   180
    /** Namespace context. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   181
    private NamespaceContext fNamespaceContext;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   182
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   183
    // temp vars
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   184
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   185
    /** Attribute QName. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   186
    private QName fAttributeQName = new QName();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   187
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   188
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   189
    // Constructors
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   190
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   191
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   192
    /** Default constructor. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   193
    public XMLNamespaceBinder() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   194
    } // <init>()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   195
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   196
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   197
    // Public methods
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   198
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   199
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   200
    // settings
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   201
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   202
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   203
     * Sets whether the namespace binder only passes the prefix mapping
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   204
     * events to the registered document handler or passes all document
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   205
     * events.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   206
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   207
     * @param onlyPassPrefixMappingEvents True to pass only the prefix
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   208
     *                                    mapping events; false to pass
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   209
     *                                    all events.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   210
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   211
    public void setOnlyPassPrefixMappingEvents(boolean onlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   212
        fOnlyPassPrefixMappingEvents = onlyPassPrefixMappingEvents;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   213
    } // setOnlyPassPrefixMappingEvents(boolean)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   214
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   215
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   216
     * Returns true if the namespace binder only passes the prefix mapping
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   217
     * events to the registered document handler; false if the namespace
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   218
     * binder passes all document events.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   219
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   220
    public boolean getOnlyPassPrefixMappingEvents() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   221
        return fOnlyPassPrefixMappingEvents;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   222
    } // getOnlyPassPrefixMappingEvents():boolean
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   223
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   224
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   225
    // XMLComponent methods
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   226
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   227
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   228
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   229
     * Resets the component. The component can query the component manager
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   230
     * about any features and properties that affect the operation of the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   231
     * component.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   232
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   233
     * @param componentManager The component manager.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   234
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   235
     * @throws SAXException Thrown by component on initialization error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   236
     *                      For example, if a feature or property is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   237
     *                      required for the operation of the component, the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   238
     *                      component manager may throw a
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   239
     *                      SAXNotRecognizedException or a
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   240
     *                      SAXNotSupportedException.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   241
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   242
    public void reset(XMLComponentManager componentManager)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   243
        throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   244
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   245
        // features
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   246
        fNamespaces = componentManager.getFeature(NAMESPACES, true);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   247
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   248
        // Xerces properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   249
        fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   250
        fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   251
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   252
    } // reset(XMLComponentManager)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   253
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   254
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   255
     * Returns a list of feature identifiers that are recognized by
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   256
     * this component. This method may return null if no features
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   257
     * are recognized by this component.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   258
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   259
    public String[] getRecognizedFeatures() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   260
        return (String[])(RECOGNIZED_FEATURES.clone());
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   261
    } // getRecognizedFeatures():String[]
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   262
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   263
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   264
     * Sets the state of a feature. This method is called by the component
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   265
     * manager any time after reset when a feature changes state.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   266
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   267
     * <strong>Note:</strong> Components should silently ignore features
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   268
     * that do not affect the operation of the component.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   269
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   270
     * @param featureId The feature identifier.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   271
     * @param state     The state of the feature.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   272
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   273
     * @throws SAXNotRecognizedException The component should not throw
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   274
     *                                   this exception.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   275
     * @throws SAXNotSupportedException The component should not throw
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   276
     *                                  this exception.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   277
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   278
    public void setFeature(String featureId, boolean state)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   279
        throws XMLConfigurationException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   280
    } // setFeature(String,boolean)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   281
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   282
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   283
     * Returns a list of property identifiers that are recognized by
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   284
     * this component. This method may return null if no properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   285
     * are recognized by this component.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   286
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   287
    public String[] getRecognizedProperties() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   288
        return (String[])(RECOGNIZED_PROPERTIES.clone());
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   289
    } // getRecognizedProperties():String[]
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   290
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   291
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   292
     * Sets the value of a property during parsing.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   293
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   294
     * @param propertyId
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   295
     * @param value
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   296
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   297
    public void setProperty(String propertyId, Object value)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   298
        throws XMLConfigurationException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   299
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   300
        // Xerces properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   301
        if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   302
                final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   303
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   304
            if (suffixLength == Constants.SYMBOL_TABLE_PROPERTY.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   305
                propertyId.endsWith(Constants.SYMBOL_TABLE_PROPERTY)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   306
                fSymbolTable = (SymbolTable)value;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   307
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   308
            else if (suffixLength == Constants.ERROR_REPORTER_PROPERTY.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   309
                propertyId.endsWith(Constants.ERROR_REPORTER_PROPERTY)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   310
                fErrorReporter = (XMLErrorReporter)value;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   311
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   312
            return;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   313
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   314
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   315
    } // setProperty(String,Object)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   316
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   317
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   318
     * Returns the default state for a feature, or null if this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   319
     * component does not want to report a default value for this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   320
     * feature.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   321
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   322
     * @param featureId The feature identifier.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   323
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   324
     * @since Xerces 2.2.0
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   325
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   326
    public Boolean getFeatureDefault(String featureId) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   327
        for (int i = 0; i < RECOGNIZED_FEATURES.length; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   328
            if (RECOGNIZED_FEATURES[i].equals(featureId)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   329
                return FEATURE_DEFAULTS[i];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   330
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   331
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   332
        return null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   333
    } // getFeatureDefault(String):Boolean
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   334
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   335
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   336
     * Returns the default state for a property, or null if this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   337
     * component does not want to report a default value for this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   338
     * property.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   339
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   340
     * @param propertyId The property identifier.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   341
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   342
     * @since Xerces 2.2.0
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   343
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   344
    public Object getPropertyDefault(String propertyId) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   345
        for (int i = 0; i < RECOGNIZED_PROPERTIES.length; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   346
            if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   347
                return PROPERTY_DEFAULTS[i];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   348
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   349
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   350
        return null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   351
    } // getPropertyDefault(String):Object
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   352
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   353
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   354
    // XMLDocumentSource methods
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   355
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   356
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   357
    /** Sets the document handler to receive information about the document. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   358
    public void setDocumentHandler(XMLDocumentHandler documentHandler) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   359
        fDocumentHandler = documentHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   360
    } // setDocumentHandler(XMLDocumentHandler)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   361
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   362
    /** Returns the document handler */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   363
    public XMLDocumentHandler getDocumentHandler() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   364
        return fDocumentHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   365
    } // setDocumentHandler(XMLDocumentHandler)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   366
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   367
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   368
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   369
    // XMLDocumentHandler methods
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   370
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   371
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   372
    /** Sets the document source */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   373
    public void setDocumentSource(XMLDocumentSource source){
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   374
        fDocumentSource = source;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   375
    } // setDocumentSource
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   376
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   377
    /** Returns the document source */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   378
    public XMLDocumentSource getDocumentSource (){
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   379
        return fDocumentSource;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   380
    } // getDocumentSource
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   381
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   382
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   383
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   384
     * This method notifies the start of a general entity.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   385
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   386
     * <strong>Note:</strong> This method is not called for entity references
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   387
     * appearing as part of attribute values.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   388
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   389
     * @param name     The name of the general entity.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   390
     * @param identifier The resource identifier.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   391
     * @param encoding The auto-detected IANA encoding name of the entity
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   392
     *                 stream. This value will be null in those situations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   393
     *                 where the entity encoding is not auto-detected (e.g.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   394
     *                 internal entities or a document entity that is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   395
     *                 parsed from a java.io.Reader).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   396
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   397
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   398
     * @exception XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   399
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   400
    public void startGeneralEntity(String name,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   401
                                   XMLResourceIdentifier identifier,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   402
                                   String encoding, Augmentations augs)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   403
        throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   404
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   405
            fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   406
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   407
    } // startEntity(String,String,String,String,String)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   408
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   409
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   410
     * Notifies of the presence of a TextDecl line in an entity. If present,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   411
     * this method will be called immediately following the startEntity call.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   412
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   413
     * <strong>Note:</strong> This method will never be called for the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   414
     * document entity; it is only called for external general entities
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   415
     * referenced in document content.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   416
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   417
     * <strong>Note:</strong> This method is not called for entity references
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   418
     * appearing as part of attribute values.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   419
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   420
     * @param version  The XML version, or null if not specified.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   421
     * @param encoding The IANA encoding name of the entity.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   422
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   423
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   424
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   425
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   426
    public void textDecl(String version, String encoding, Augmentations augs)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   427
        throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   428
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   429
            fDocumentHandler.textDecl(version, encoding, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   430
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   431
    } // textDecl(String,String)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   432
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   433
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   434
     * The start of the document.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   435
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   436
     * @param locator  The system identifier of the entity if the entity
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   437
     *                 is external, null otherwise.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   438
     * @param encoding The auto-detected IANA encoding name of the entity
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   439
     *                 stream. This value will be null in those situations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   440
     *                 where the entity encoding is not auto-detected (e.g.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   441
     *                 internal entities or a document entity that is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   442
     *                 parsed from a java.io.Reader).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   443
     * @param namespaceContext
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   444
     *                 The namespace context in effect at the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   445
     *                 start of this document.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   446
     *                 This object represents the current context.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   447
     *                 Implementors of this class are responsible
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   448
     *                 for copying the namespace bindings from the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   449
     *                 the current context (and its parent contexts)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   450
     *                 if that information is important.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   451
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   452
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   453
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   454
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   455
        public void startDocument(XMLLocator locator, String encoding,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   456
                                NamespaceContext namespaceContext, Augmentations augs)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   457
                                      throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   458
                fNamespaceContext = namespaceContext;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   459
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   460
                if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   461
                        fDocumentHandler.startDocument(locator, encoding, namespaceContext, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   462
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   463
        } // startDocument(XMLLocator,String)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   464
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   465
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   466
     * Notifies of the presence of an XMLDecl line in the document. If
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   467
     * present, this method will be called immediately following the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   468
     * startDocument call.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   469
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   470
     * @param version    The XML version.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   471
     * @param encoding   The IANA encoding name of the document, or null if
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   472
     *                   not specified.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   473
     * @param standalone The standalone value, or null if not specified.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   474
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   475
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   476
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   477
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   478
    public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   479
        throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   480
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   481
            fDocumentHandler.xmlDecl(version, encoding, standalone, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   482
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   483
    } // xmlDecl(String,String,String)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   484
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   485
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   486
     * Notifies of the presence of the DOCTYPE line in the document.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   487
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   488
     * @param rootElement The name of the root element.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   489
     * @param publicId    The public identifier if an external DTD or null
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   490
     *                    if the external DTD is specified using SYSTEM.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   491
     * @param systemId    The system identifier if an external DTD, null
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   492
     *                    otherwise.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   493
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   494
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   495
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   496
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   497
    public void doctypeDecl(String rootElement,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   498
                            String publicId, String systemId, Augmentations augs)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   499
        throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   500
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   501
            fDocumentHandler.doctypeDecl(rootElement, publicId, systemId, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   502
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   503
    } // doctypeDecl(String,String,String)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   504
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   505
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   506
     * A comment.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   507
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   508
     * @param text The text in the comment.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   509
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   510
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   511
     * @throws XNIException Thrown by application to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   512
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   513
    public void comment(XMLString text, Augmentations augs) throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   514
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   515
            fDocumentHandler.comment(text, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   516
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   517
    } // comment(XMLString)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   518
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   519
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   520
     * A processing instruction. Processing instructions consist of a
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   521
     * target name and, optionally, text data. The data is only meaningful
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   522
     * to the application.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   523
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   524
     * Typically, a processing instruction's data will contain a series
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   525
     * of pseudo-attributes. These pseudo-attributes follow the form of
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   526
     * element attributes but are <strong>not</strong> parsed or presented
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   527
     * to the application as anything other than text. The application is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   528
     * responsible for parsing the data.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   529
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   530
     * @param target The target.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   531
     * @param data   The data or null if none specified.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   532
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   533
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   534
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   535
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   536
    public void processingInstruction(String target, XMLString data, Augmentations augs)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   537
        throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   538
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   539
            fDocumentHandler.processingInstruction(target, data, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   540
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   541
    } // processingInstruction(String,XMLString)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   542
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   543
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   544
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   545
     * Binds the namespaces. This method will handle calling the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   546
     * document handler to start the prefix mappings.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   547
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   548
     * <strong>Note:</strong> This method makes use of the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   549
     * fAttributeQName variable. Any contents of the variable will
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   550
     * be destroyed. Caller should copy the values out of this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   551
     * temporary variable before calling this method.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   552
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   553
     * @param element    The name of the element.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   554
     * @param attributes The element attributes.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   555
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   556
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   557
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   558
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   559
    public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   560
        throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   561
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   562
        if (fNamespaces) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   563
            handleStartElement(element, attributes, augs, false);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   564
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   565
        else if (fDocumentHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   566
            fDocumentHandler.startElement(element, attributes, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   567
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   568
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   569
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   570
    } // startElement(QName,XMLAttributes)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   571
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   572
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   573
     * An empty element.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   574
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   575
     * @param element    The name of the element.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   576
     * @param attributes The element attributes.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   577
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   578
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   579
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   580
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   581
    public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   582
        throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   583
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   584
        if (fNamespaces) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   585
            handleStartElement(element, attributes, augs, true);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   586
            handleEndElement(element, augs, true);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   587
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   588
        else if (fDocumentHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   589
            fDocumentHandler.emptyElement(element, attributes, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   590
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   591
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   592
    } // emptyElement(QName,XMLAttributes)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   593
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   594
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   595
     * Character content.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   596
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   597
     * @param text The content.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   598
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   599
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   600
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   601
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   602
    public void characters(XMLString text, Augmentations augs) throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   603
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   604
            fDocumentHandler.characters(text, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   605
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   606
    } // characters(XMLString)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   607
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   608
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   609
     * Ignorable whitespace. For this method to be called, the document
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   610
     * source must have some way of determining that the text containing
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   611
     * only whitespace characters should be considered ignorable. For
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   612
     * example, the validator can determine if a length of whitespace
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   613
     * characters in the document are ignorable based on the element
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   614
     * content model.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   615
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   616
     * @param text The ignorable whitespace.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   617
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   618
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   619
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   620
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   621
    public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   622
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   623
            fDocumentHandler.ignorableWhitespace(text, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   624
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   625
    } // ignorableWhitespace(XMLString)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   626
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   627
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   628
     * The end of an element.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   629
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   630
     * @param element The name of the element.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   631
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   632
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   633
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   634
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   635
    public void endElement(QName element, Augmentations augs) throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   636
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   637
        if (fNamespaces) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   638
            handleEndElement(element, augs, false);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   639
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   640
        else if (fDocumentHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   641
            fDocumentHandler.endElement(element, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   642
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   643
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   644
    } // endElement(QName)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   645
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   646
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   647
     * The start of a CDATA section.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   648
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   649
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   650
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   651
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   652
    public void startCDATA(Augmentations augs) throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   653
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   654
            fDocumentHandler.startCDATA(augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   655
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   656
    } // startCDATA()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   657
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   658
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   659
     * The end of a CDATA section.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   660
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   661
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   662
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   663
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   664
    public void endCDATA(Augmentations augs) throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   665
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   666
            fDocumentHandler.endCDATA(augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   667
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   668
    } // endCDATA()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   669
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   670
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   671
     * The end of the document.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   672
     * @param augs     Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   673
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   674
     * @throws XNIException Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   675
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   676
    public void endDocument(Augmentations augs) throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   677
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   678
            fDocumentHandler.endDocument(augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   679
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   680
    } // endDocument()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   681
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   682
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   683
     * This method notifies the end of a general entity.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   684
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   685
     * <strong>Note:</strong> This method is not called for entity references
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   686
     * appearing as part of attribute values.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   687
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   688
     * @param name   The name of the entity.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   689
     * @param augs   Additional information that may include infoset augmentations
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   690
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   691
     * @exception XNIException
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   692
     *                   Thrown by handler to signal an error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   693
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   694
    public void endGeneralEntity(String name, Augmentations augs) throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   695
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   696
            fDocumentHandler.endGeneralEntity(name, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   697
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   698
    } // endEntity(String)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   699
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   700
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   701
    // Protected methods
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   702
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   703
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   704
    /** Handles start element. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   705
    protected void handleStartElement(QName element, XMLAttributes attributes,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   706
                                      Augmentations augs,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   707
                                      boolean isEmpty) throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   708
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   709
        // add new namespace context
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   710
        fNamespaceContext.pushContext();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   711
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   712
        if (element.prefix == XMLSymbols.PREFIX_XMLNS) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   713
            fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   714
                                       "ElementXMLNSPrefix",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   715
                                       new Object[]{element.rawname},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   716
                                       XMLErrorReporter.SEVERITY_FATAL_ERROR);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   717
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   718
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   719
        // search for new namespace bindings
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   720
        int length = attributes.getLength();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   721
        for (int i = 0; i < length; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   722
            String localpart = attributes.getLocalName(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   723
            String prefix = attributes.getPrefix(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   724
            // when it's of form xmlns="..." or xmlns:prefix="...",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   725
            // it's a namespace declaration. but prefix:xmlns="..." isn't.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   726
            if (prefix == XMLSymbols.PREFIX_XMLNS ||
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   727
                prefix == XMLSymbols.EMPTY_STRING && localpart == XMLSymbols.PREFIX_XMLNS) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   728
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   729
                // get the internalized value of this attribute
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   730
                String uri = fSymbolTable.addSymbol(attributes.getValue(i));
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   731
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   732
                // 1. "xmlns" can't be bound to any namespace
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   733
                if (prefix == XMLSymbols.PREFIX_XMLNS && localpart == XMLSymbols.PREFIX_XMLNS) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   734
                    fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   735
                                               "CantBindXMLNS",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   736
                                               new Object[]{attributes.getQName(i)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   737
                                               XMLErrorReporter.SEVERITY_FATAL_ERROR);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   738
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   739
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   740
                // 2. the namespace for "xmlns" can't be bound to any prefix
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   741
                if (uri == NamespaceContext.XMLNS_URI) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   742
                    fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   743
                                               "CantBindXMLNS",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   744
                                               new Object[]{attributes.getQName(i)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   745
                                               XMLErrorReporter.SEVERITY_FATAL_ERROR);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   746
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   747
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   748
                // 3. "xml" can't be bound to any other namespace than it's own
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   749
                if (localpart == XMLSymbols.PREFIX_XML) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   750
                    if (uri != NamespaceContext.XML_URI) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   751
                        fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   752
                                                   "CantBindXML",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   753
                                                   new Object[]{attributes.getQName(i)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   754
                                                   XMLErrorReporter.SEVERITY_FATAL_ERROR);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   755
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   756
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   757
                // 4. the namespace for "xml" can't be bound to any other prefix
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   758
                else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   759
                    if (uri ==NamespaceContext.XML_URI) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   760
                        fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   761
                                                   "CantBindXML",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   762
                                                   new Object[]{attributes.getQName(i)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   763
                                                   XMLErrorReporter.SEVERITY_FATAL_ERROR);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   764
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   765
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   766
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   767
                prefix = localpart != XMLSymbols.PREFIX_XMLNS ? localpart : XMLSymbols.EMPTY_STRING;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   768
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   769
                // http://www.w3.org/TR/1999/REC-xml-names-19990114/#dt-prefix
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   770
                // We should only report an error if there is a prefix,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   771
                // that is, the local part is not "xmlns". -SG
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   772
                // Since this is an error condition in XML 1.0,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   773
                // and should be relatively uncommon in XML 1.1,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   774
                // making this test into a method call to reuse code
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   775
                // should be acceptable.  - NG
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   776
                if(prefixBoundToNullURI(uri, localpart)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   777
                    fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   778
                                               "EmptyPrefixedAttName",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   779
                                               new Object[]{attributes.getQName(i)},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   780
                                               XMLErrorReporter.SEVERITY_FATAL_ERROR);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   781
                    continue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   782
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   783
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   784
                // declare prefix in context
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   785
                fNamespaceContext.declarePrefix(prefix, uri.length() != 0 ? uri : null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   786
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   787
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   788
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   789
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   790
        // bind the element
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   791
        String prefix = element.prefix != null
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   792
                      ? element.prefix : XMLSymbols.EMPTY_STRING;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   793
        element.uri = fNamespaceContext.getURI(prefix);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   794
        if (element.prefix == null && element.uri != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   795
            element.prefix = XMLSymbols.EMPTY_STRING;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   796
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   797
        if (element.prefix != null && element.uri == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   798
            fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   799
                                       "ElementPrefixUnbound",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   800
                                       new Object[]{element.prefix, element.rawname},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   801
                                       XMLErrorReporter.SEVERITY_FATAL_ERROR);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   802
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   803
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   804
        // bind the attributes
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   805
        for (int i = 0; i < length; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   806
            attributes.getName(i, fAttributeQName);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   807
            String aprefix = fAttributeQName.prefix != null
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   808
                           ? fAttributeQName.prefix : XMLSymbols.EMPTY_STRING;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   809
            String arawname = fAttributeQName.rawname;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   810
            if (arawname == XMLSymbols.PREFIX_XMLNS) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   811
                fAttributeQName.uri = fNamespaceContext.getURI(XMLSymbols.PREFIX_XMLNS);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   812
                attributes.setName(i, fAttributeQName);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   813
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   814
            else if (aprefix != XMLSymbols.EMPTY_STRING) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   815
                fAttributeQName.uri = fNamespaceContext.getURI(aprefix);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   816
                if (fAttributeQName.uri == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   817
                    fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   818
                                               "AttributePrefixUnbound",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   819
                                               new Object[]{element.rawname,arawname,aprefix},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   820
                                               XMLErrorReporter.SEVERITY_FATAL_ERROR);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   821
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   822
                attributes.setName(i, fAttributeQName);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   823
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   824
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   825
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   826
        // verify that duplicate attributes don't exist
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   827
        // Example: <foo xmlns:a='NS' xmlns:b='NS' a:attr='v1' b:attr='v2'/>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   828
        int attrCount = attributes.getLength();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   829
        for (int i = 0; i < attrCount - 1; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   830
            String auri = attributes.getURI(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   831
            if (auri == null || auri == NamespaceContext.XMLNS_URI) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   832
                continue;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   833
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   834
            String alocalpart = attributes.getLocalName(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   835
            for (int j = i + 1; j < attrCount; j++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   836
                String blocalpart = attributes.getLocalName(j);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   837
                String buri = attributes.getURI(j);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   838
                if (alocalpart == blocalpart && auri == buri) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   839
                    fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   840
                                               "AttributeNSNotUnique",
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   841
                                               new Object[]{element.rawname,alocalpart, auri},
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   842
                                               XMLErrorReporter.SEVERITY_FATAL_ERROR);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   843
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   844
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   845
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   846
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   847
        // call handler
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   848
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   849
            if (isEmpty) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   850
                fDocumentHandler.emptyElement(element, attributes, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   851
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   852
            else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   853
                fDocumentHandler.startElement(element, attributes, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   854
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   855
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   856
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   857
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   858
    } // handleStartElement(QName,XMLAttributes,boolean)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   859
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   860
    /** Handles end element. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   861
    protected void handleEndElement(QName element, Augmentations augs, boolean isEmpty)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   862
        throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   863
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   864
        // bind element
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   865
        String eprefix = element.prefix != null ? element.prefix : XMLSymbols.EMPTY_STRING;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   866
        element.uri = fNamespaceContext.getURI(eprefix);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   867
        if (element.uri != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   868
            element.prefix = eprefix;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   869
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   870
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   871
        // call handlers
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   872
        if (fDocumentHandler != null && !fOnlyPassPrefixMappingEvents) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   873
            if (!isEmpty) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   874
                fDocumentHandler.endElement(element, augs);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   875
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   876
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   877
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   878
        // pop context
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   879
        fNamespaceContext.popContext();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   880
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   881
    } // handleEndElement(QName,boolean)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   882
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   883
    // returns true iff the given prefix is bound to "" *and*
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   884
    // this is disallowed by the version of XML namespaces in use.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   885
    protected boolean prefixBoundToNullURI(String uri, String localpart) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   886
        return (uri == XMLSymbols.EMPTY_STRING && localpart != XMLSymbols.PREFIX_XMLNS);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   887
    } // prefixBoundToNullURI(String, String):  boolean
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   888
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   889
} // class XMLNamespaceBinder