jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java
author joehw
Tue, 20 Aug 2013 09:02:25 -0700
changeset 20973 cc1cc8eb501b
parent 20968 dde41f8b7b96
child 25264 040625ce9b72
permissions -rw-r--r--
8022682: Supporting XOM Reviewed-by: alanb, chegar, lancea
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
 * Copyright 2001-2005 The Apache Software Foundation.
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
 * Licensed under the Apache License, Version 2.0 (the "License");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
     9
 * you may not use this file except in compliance with the License.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    10
 * You may obtain a copy of the License at
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
 *      http://www.apache.org/licenses/LICENSE-2.0
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    13
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    14
 * Unless required by applicable law or agreed to in writing, software
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    15
 * distributed under the License is distributed on an "AS IS" BASIS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    17
 * See the License for the specific language governing permissions and
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    18
 * limitations under the License.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    19
 */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    20
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    21
package com.sun.org.apache.xerces.internal.parsers;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    22
20968
dde41f8b7b96 8014530: Better digital signature processing
joehw
parents: 20967
diff changeset
    23
import java.io.IOException;
dde41f8b7b96 8014530: Better digital signature processing
joehw
parents: 20967
diff changeset
    24
import java.util.ArrayList;
dde41f8b7b96 8014530: Better digital signature processing
joehw
parents: 20967
diff changeset
    25
import java.util.HashMap;
dde41f8b7b96 8014530: Better digital signature processing
joehw
parents: 20967
diff changeset
    26
import java.util.Locale;
dde41f8b7b96 8014530: Better digital signature processing
joehw
parents: 20967
diff changeset
    27
import javax.xml.XMLConstants;
dde41f8b7b96 8014530: Better digital signature processing
joehw
parents: 20967
diff changeset
    28
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    29
import com.sun.org.apache.xerces.internal.impl.Constants;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    30
import com.sun.org.apache.xerces.internal.impl.XML11DTDScannerImpl;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    31
import com.sun.org.apache.xerces.internal.impl.XML11DocumentScannerImpl;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    32
import com.sun.org.apache.xerces.internal.impl.XML11NSDocumentScannerImpl;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    33
import com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    34
import com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    35
import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    36
import com.sun.org.apache.xerces.internal.impl.XMLEntityManager;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    37
import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    38
import com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    39
import com.sun.org.apache.xerces.internal.impl.XMLVersionDetector;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    40
import com.sun.org.apache.xerces.internal.impl.dtd.XML11DTDProcessor;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    41
import com.sun.org.apache.xerces.internal.impl.dtd.XML11DTDValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    42
import com.sun.org.apache.xerces.internal.impl.dtd.XML11NSDTDValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    43
import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDProcessor;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    44
import com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    45
import com.sun.org.apache.xerces.internal.impl.dtd.XMLNSDTDValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    46
import com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    47
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    48
import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    49
import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    50
import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    51
import com.sun.org.apache.xerces.internal.util.FeatureState;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    52
import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    53
import com.sun.org.apache.xerces.internal.util.PropertyState;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    54
import com.sun.org.apache.xerces.internal.util.SymbolTable;
20968
dde41f8b7b96 8014530: Better digital signature processing
joehw
parents: 20967
diff changeset
    55
import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager;
18890
25bdeca3173b 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown
joehw
parents: 17534
diff changeset
    56
import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager;
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    57
import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    58
import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    59
import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    60
import com.sun.org.apache.xerces.internal.xni.XMLLocator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    61
import com.sun.org.apache.xerces.internal.xni.XNIException;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    62
import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    63
import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    64
import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    65
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    66
import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    67
import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    68
import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    69
import com.sun.org.apache.xerces.internal.xni.parser.XMLEntityResolver;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    70
import com.sun.org.apache.xerces.internal.xni.parser.XMLErrorHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    71
import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    72
import com.sun.org.apache.xerces.internal.xni.parser.XMLPullParserConfiguration;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    73
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    74
/**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    75
 * This class is the configuration used to parse XML 1.0 and XML 1.1 documents.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    76
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    77
 * @author Elena Litani, IBM
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    78
 * @author Neil Graham, IBM
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    79
 * @author Michael Glavassevich, IBM
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    80
 *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    81
 * @version $Id: XML11Configuration.java,v 1.9 2010-11-01 04:40:10 joehw Exp $
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
public class XML11Configuration extends ParserConfigurationSettings
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    84
    implements XMLPullParserConfiguration, XML11Configurable {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    85
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    86
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    87
    // Constants
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    88
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    89
    protected final static String XML11_DATATYPE_VALIDATOR_FACTORY =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    90
        "com.sun.org.apache.xerces.internal.impl.dv.dtd.XML11DTDDVFactoryImpl";
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    91
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    92
    // feature identifiers
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    93
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    94
    /** Feature identifier: warn on duplicate attribute definition. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    95
    protected static final String WARN_ON_DUPLICATE_ATTDEF =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    96
        Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ATTDEF_FEATURE;
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
    /** Feature identifier: warn on duplicate entity definition. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
    99
    protected static final String WARN_ON_DUPLICATE_ENTITYDEF =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   100
        Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE;
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
    /** Feature identifier: warn on undeclared element definition. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   103
    protected static final String WARN_ON_UNDECLARED_ELEMDEF =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   104
        Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_UNDECLARED_ELEMDEF_FEATURE;
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
    /** Feature identifier: allow Java encodings. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   107
    protected static final String ALLOW_JAVA_ENCODINGS =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   108
        Constants.XERCES_FEATURE_PREFIX + Constants.ALLOW_JAVA_ENCODINGS_FEATURE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   109
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   110
    /** Feature identifier: continue after fatal error. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   111
    protected static final String CONTINUE_AFTER_FATAL_ERROR =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   112
        Constants.XERCES_FEATURE_PREFIX + Constants.CONTINUE_AFTER_FATAL_ERROR_FEATURE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   113
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   114
    /** Feature identifier: load external DTD. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   115
    protected static final String LOAD_EXTERNAL_DTD =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   116
        Constants.XERCES_FEATURE_PREFIX + Constants.LOAD_EXTERNAL_DTD_FEATURE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   117
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   118
    /** Feature identifier: notify built-in refereces. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   119
    protected static final String NOTIFY_BUILTIN_REFS =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   120
        Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_BUILTIN_REFS_FEATURE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   121
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   122
    /** Feature identifier: notify character refereces. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   123
    protected static final String NOTIFY_CHAR_REFS =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   124
        Constants.XERCES_FEATURE_PREFIX + Constants.NOTIFY_CHAR_REFS_FEATURE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   125
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   126
    /** Feature identifier: expose schema normalized value */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   127
    protected static final String NORMALIZE_DATA =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   128
        Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_NORMALIZED_VALUE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   129
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   130
    /** Feature identifier: send element default value via characters() */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   131
    protected static final String SCHEMA_ELEMENT_DEFAULT =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   132
        Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_ELEMENT_DEFAULT;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   133
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   134
    /** Feature identifier: augment PSVI */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   135
    protected static final String SCHEMA_AUGMENT_PSVI =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   136
        Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_AUGMENT_PSVI;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   137
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   138
    /** feature identifier: XML Schema validation */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   139
    protected static final String XMLSCHEMA_VALIDATION =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   140
        Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_VALIDATION_FEATURE;
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
    /** feature identifier: XML Schema validation -- full checking */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   143
    protected static final String XMLSCHEMA_FULL_CHECKING =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   144
        Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   145
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   146
    /** Feature: generate synthetic annotations */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   147
    protected static final String GENERATE_SYNTHETIC_ANNOTATIONS =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   148
        Constants.XERCES_FEATURE_PREFIX + Constants.GENERATE_SYNTHETIC_ANNOTATIONS_FEATURE;
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
    /** Feature identifier: validate annotations */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   151
    protected static final String VALIDATE_ANNOTATIONS =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   152
        Constants.XERCES_FEATURE_PREFIX + Constants.VALIDATE_ANNOTATIONS_FEATURE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   153
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   154
    /** Feature identifier: honour all schemaLocations */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   155
    protected static final String HONOUR_ALL_SCHEMALOCATIONS =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   156
        Constants.XERCES_FEATURE_PREFIX + Constants.HONOUR_ALL_SCHEMALOCATIONS_FEATURE;
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
    /** Feature identifier: namespace growth */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   159
    protected static final String NAMESPACE_GROWTH =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   160
        Constants.XERCES_FEATURE_PREFIX + Constants.NAMESPACE_GROWTH_FEATURE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   161
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   162
    /** Feature identifier: tolerate duplicates */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   163
    protected static final String TOLERATE_DUPLICATES =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   164
        Constants.XERCES_FEATURE_PREFIX + Constants.TOLERATE_DUPLICATES_FEATURE;
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
    /** Feature identifier: use grammar pool only */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   167
    protected static final String USE_GRAMMAR_POOL_ONLY =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   168
        Constants.XERCES_FEATURE_PREFIX + Constants.USE_GRAMMAR_POOL_ONLY_FEATURE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   169
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   170
        // feature identifiers
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   171
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   172
        /** Feature identifier: validation. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   173
        protected static final String VALIDATION =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   174
                Constants.SAX_FEATURE_PREFIX + Constants.VALIDATION_FEATURE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   175
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   176
        /** Feature identifier: namespaces. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   177
        protected static final String NAMESPACES =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   178
                Constants.SAX_FEATURE_PREFIX + Constants.NAMESPACES_FEATURE;
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
        /** Feature identifier: external general entities. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   181
        protected static final String EXTERNAL_GENERAL_ENTITIES =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   182
                Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_GENERAL_ENTITIES_FEATURE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   183
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   184
        /** Feature identifier: external parameter entities. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   185
        protected static final String EXTERNAL_PARAMETER_ENTITIES =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   186
                Constants.SAX_FEATURE_PREFIX + Constants.EXTERNAL_PARAMETER_ENTITIES_FEATURE;
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
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   190
    // property identifiers
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
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   193
        /** Property identifier: xml string. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   194
        protected static final String XML_STRING =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   195
                Constants.SAX_PROPERTY_PREFIX + Constants.XML_STRING_PROPERTY;
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
        /** Property identifier: symbol table. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   198
        protected static final String SYMBOL_TABLE =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   199
                Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   200
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   201
        /** Property identifier: error handler. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   202
        protected static final String ERROR_HANDLER =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   203
                Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   204
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   205
        /** Property identifier: entity resolver. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   206
        protected static final String ENTITY_RESOLVER =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   207
                Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   208
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   209
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   210
    /** Property identifier: XML Schema validator. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   211
    protected static final String SCHEMA_VALIDATOR =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   212
        Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_VALIDATOR_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   213
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   214
    /** Property identifier: schema location. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   215
    protected static final String SCHEMA_LOCATION =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   216
        Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_LOCATION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   217
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   218
    /** Property identifier: no namespace schema location. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   219
    protected static final String SCHEMA_NONS_LOCATION =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   220
        Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_NONS_LOCATION;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   221
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   222
    // property identifiers
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
    /** Property identifier: error reporter. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   225
    protected static final String ERROR_REPORTER =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   226
        Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY;
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
    /** Property identifier: entity manager. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   229
    protected static final String ENTITY_MANAGER =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   230
        Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   231
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   232
    /** Property identifier document scanner: */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   233
    protected static final String DOCUMENT_SCANNER =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   234
        Constants.XERCES_PROPERTY_PREFIX + Constants.DOCUMENT_SCANNER_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   235
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   236
    /** Property identifier: DTD scanner. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   237
    protected static final String DTD_SCANNER =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   238
        Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_SCANNER_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   239
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   240
    /** Property identifier: grammar pool. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   241
    protected static final String XMLGRAMMAR_POOL =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   242
        Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   243
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   244
    /** Property identifier: DTD loader. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   245
    protected static final String DTD_PROCESSOR =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   246
        Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_PROCESSOR_PROPERTY;
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
    /** Property identifier: DTD validator. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   249
    protected static final String DTD_VALIDATOR =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   250
        Constants.XERCES_PROPERTY_PREFIX + Constants.DTD_VALIDATOR_PROPERTY;
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
    /** Property identifier: namespace binder. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   253
    protected static final String NAMESPACE_BINDER =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   254
        Constants.XERCES_PROPERTY_PREFIX + Constants.NAMESPACE_BINDER_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   255
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   256
    /** Property identifier: datatype validator factory. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   257
    protected static final String DATATYPE_VALIDATOR_FACTORY =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   258
        Constants.XERCES_PROPERTY_PREFIX + Constants.DATATYPE_VALIDATOR_FACTORY_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   259
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   260
    protected static final String VALIDATION_MANAGER =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   261
        Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY;
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
    /** Property identifier: JAXP schema language / DOM schema-type. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   264
    protected static final String JAXP_SCHEMA_LANGUAGE =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   265
        Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   266
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   267
    /** Property identifier: JAXP schema source/ DOM schema-location. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   268
    protected static final String JAXP_SCHEMA_SOURCE =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   269
        Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_SOURCE;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   270
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   271
    /** Property identifier: locale. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   272
    protected static final String LOCALE =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   273
        Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   274
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   275
    /** Property identifier: Schema DV Factory */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   276
    protected static final String SCHEMA_DV_FACTORY =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   277
        Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   278
18890
25bdeca3173b 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown
joehw
parents: 17534
diff changeset
   279
    /** Property identifier: Security property manager. */
25bdeca3173b 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown
joehw
parents: 17534
diff changeset
   280
    private static final String XML_SECURITY_PROPERTY_MANAGER =
25bdeca3173b 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown
joehw
parents: 17534
diff changeset
   281
            Constants.XML_SECURITY_PROPERTY_MANAGER;
17534
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   282
20968
dde41f8b7b96 8014530: Better digital signature processing
joehw
parents: 20967
diff changeset
   283
    /** Property identifier: Security manager. */
dde41f8b7b96 8014530: Better digital signature processing
joehw
parents: 20967
diff changeset
   284
    private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER;
17534
21dc0b2762da 8011653: Upgrade JDK8 to JAXP 1.5
joehw
parents: 12457
diff changeset
   285
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   286
    // debugging
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   287
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   288
    /** Set to true and recompile to print exception stack trace. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   289
    protected static final boolean PRINT_EXCEPTION_STACK_TRACE = false;
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
    // Data
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
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   295
        protected SymbolTable fSymbolTable;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   296
    protected XMLInputSource fInputSource;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   297
    protected ValidationManager fValidationManager;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   298
        protected XMLVersionDetector fVersionDetector;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   299
    protected XMLLocator fLocator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   300
        protected Locale fLocale;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   301
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   302
        /** XML 1.0 Components. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   303
        protected ArrayList fComponents;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   304
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   305
        /** XML 1.1. Components. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   306
        protected ArrayList fXML11Components = null;
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
        /** Common components: XMLEntityManager, XMLErrorReporter, XMLSchemaValidator */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   309
        protected ArrayList fCommonComponents = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   310
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   311
        /** The document handler. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   312
        protected XMLDocumentHandler fDocumentHandler;
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
        /** The DTD handler. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   315
        protected XMLDTDHandler fDTDHandler;
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
        /** The DTD content model handler. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   318
        protected XMLDTDContentModelHandler fDTDContentModelHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   319
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   320
        /** Last component in the document pipeline */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   321
        protected XMLDocumentSource fLastComponent;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   322
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
     * True if a parse is in progress. This state is needed because
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   325
     * some features/properties cannot be set while parsing (e.g.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   326
     * validation and namespaces).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   327
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   328
    protected boolean fParseInProgress = false;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   329
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   330
    /** fConfigUpdated is set to true if there has been any change to the configuration settings,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   331
     * i.e a feature or a property was changed.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   332
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   333
        protected boolean fConfigUpdated = false;
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
    // XML 1.0 components
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   337
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   338
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   339
    /** The XML 1.0 Datatype validator factory. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   340
    protected DTDDVFactory fDatatypeValidatorFactory;
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
    /** The XML 1.0 Document scanner that does namespace binding. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   343
    protected XMLNSDocumentScannerImpl fNamespaceScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   344
    /** The XML 1.0 Non-namespace implementation of scanner */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   345
    protected XMLDocumentScannerImpl fNonNSScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   346
    /** The XML 1.0 DTD Validator: binds namespaces */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   347
    protected XMLDTDValidator fDTDValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   348
    /** The XML 1.0 DTD Validator that does not bind namespaces */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   349
    protected XMLDTDValidator fNonNSDTDValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   350
    /** The XML 1.0 DTD scanner. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   351
    protected XMLDTDScanner fDTDScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   352
    /** The XML 1.0 DTD Processor . */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   353
    protected XMLDTDProcessor fDTDProcessor;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   354
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
    // XML 1.1 components
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   357
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   358
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   359
    /** The XML 1.1 datatype factory. **/
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   360
    protected DTDDVFactory fXML11DatatypeFactory = null;
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
    /** The XML 1.1 document scanner that does namespace binding. **/
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   363
    protected XML11NSDocumentScannerImpl fXML11NSDocScanner = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   364
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   365
    /** The XML 1.1 document scanner that does not do namespace binding. **/
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   366
    protected XML11DocumentScannerImpl fXML11DocScanner = null;
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
    /** The XML 1.1 DTD validator that does namespace binding. **/
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   369
    protected XML11NSDTDValidator fXML11NSDTDValidator = null;
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
    /** The XML 1.1 DTD validator that does not do namespace binding. **/
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   372
    protected XML11DTDValidator fXML11DTDValidator = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   373
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   374
    /** The XML 1.1 DTD scanner. **/
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   375
    protected XML11DTDScannerImpl fXML11DTDScanner = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   376
    /** The XML 1.1 DTD processor. **/
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   377
    protected XML11DTDProcessor fXML11DTDProcessor = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   378
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   379
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   380
    // Common components
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
    /** Grammar pool. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   384
    protected XMLGrammarPool fGrammarPool;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   385
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   386
    /** Error reporter. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   387
    protected XMLErrorReporter fErrorReporter;
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
    /** Entity manager. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   390
    protected XMLEntityManager fEntityManager;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   391
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   392
    /** XML Schema Validator. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   393
    protected XMLSchemaValidator fSchemaValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   394
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   395
    /** Current scanner */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   396
    protected XMLDocumentScanner fCurrentScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   397
    /** Current Datatype validator factory. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   398
    protected DTDDVFactory fCurrentDVFactory;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   399
    /** Current DTD scanner. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   400
    protected XMLDTDScanner fCurrentDTDScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   401
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   402
    /** Flag indiciating whether XML11 components have been initialized. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   403
    private boolean f11Initialized = false;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   404
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   405
    //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   406
    // Constructors
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   407
    //
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
    /** Default constructor. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   410
    public XML11Configuration() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   411
        this(null, null, null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   412
    } // <init>()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   413
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   414
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   415
     * Constructs a parser configuration using the specified symbol table.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   416
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   417
     * @param symbolTable The symbol table to use.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   418
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   419
    public XML11Configuration(SymbolTable symbolTable) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   420
        this(symbolTable, null, null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   421
    } // <init>(SymbolTable)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   422
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
     * Constructs a parser configuration using the specified symbol table and
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   425
     * grammar pool.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   426
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   427
     * <strong>REVISIT:</strong>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   428
     * Grammar pool will be updated when the new validation engine is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   429
     * implemented.
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
     * @param symbolTable The symbol table to use.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   432
     * @param grammarPool The grammar pool to use.
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
    public XML11Configuration(SymbolTable symbolTable, XMLGrammarPool grammarPool) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   435
        this(symbolTable, grammarPool, null);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   436
    } // <init>(SymbolTable,XMLGrammarPool)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   437
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   438
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   439
     * Constructs a parser configuration using the specified symbol table,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   440
     * grammar pool, and parent settings.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   441
     * <p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   442
     * <strong>REVISIT:</strong>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   443
     * Grammar pool will be updated when the new validation engine is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   444
     * implemented.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   445
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   446
     * @param symbolTable    The symbol table to use.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   447
     * @param grammarPool    The grammar pool to use.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   448
     * @param parentSettings The parent settings.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   449
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   450
    public XML11Configuration(
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   451
        SymbolTable symbolTable,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   452
        XMLGrammarPool grammarPool,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   453
        XMLComponentManager parentSettings) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   454
20963
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   455
        super(parentSettings);
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   456
20963
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   457
        // create a vector to hold all the components in use
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   458
        // XML 1.0 specialized components
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   459
        fComponents = new ArrayList();
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   460
        // XML 1.1 specialized components
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   461
        fXML11Components = new ArrayList();
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   462
        // Common components for XML 1.1. and XML 1.0
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   463
        fCommonComponents = new ArrayList();
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   464
20963
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   465
        // create table for features and properties
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   466
        fFeatures = new HashMap();
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   467
        fProperties = new HashMap();
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   468
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   469
        // add default recognized features
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   470
        final String[] recognizedFeatures =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   471
            {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   472
                CONTINUE_AFTER_FATAL_ERROR, LOAD_EXTERNAL_DTD, // from XMLDTDScannerImpl
20963
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   473
                VALIDATION,
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   474
                NAMESPACES,
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   475
                NORMALIZE_DATA, SCHEMA_ELEMENT_DEFAULT, SCHEMA_AUGMENT_PSVI,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   476
                GENERATE_SYNTHETIC_ANNOTATIONS, VALIDATE_ANNOTATIONS,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   477
                HONOUR_ALL_SCHEMALOCATIONS, NAMESPACE_GROWTH,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   478
                TOLERATE_DUPLICATES,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   479
                USE_GRAMMAR_POOL_ONLY,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   480
                // NOTE: These shouldn't really be here but since the XML Schema
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   481
                //       validator is constructed dynamically, its recognized
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   482
                //       features might not have been set and it would cause a
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   483
                //       not-recognized exception to be thrown. -Ac
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   484
                XMLSCHEMA_VALIDATION, XMLSCHEMA_FULL_CHECKING,
20963
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   485
                EXTERNAL_GENERAL_ENTITIES,
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   486
                EXTERNAL_PARAMETER_ENTITIES,
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   487
                PARSER_SETTINGS,
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   488
                XMLConstants.FEATURE_SECURE_PROCESSING
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   489
                        };
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   490
        addRecognizedFeatures(recognizedFeatures);
20963
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   491
        // set state for default features
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   492
        fFeatures.put(VALIDATION, Boolean.FALSE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   493
        fFeatures.put(NAMESPACES, Boolean.TRUE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   494
        fFeatures.put(EXTERNAL_GENERAL_ENTITIES, Boolean.TRUE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   495
        fFeatures.put(EXTERNAL_PARAMETER_ENTITIES, Boolean.TRUE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   496
        fFeatures.put(CONTINUE_AFTER_FATAL_ERROR, Boolean.FALSE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   497
        fFeatures.put(LOAD_EXTERNAL_DTD, Boolean.TRUE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   498
        fFeatures.put(SCHEMA_ELEMENT_DEFAULT, Boolean.TRUE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   499
        fFeatures.put(NORMALIZE_DATA, Boolean.TRUE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   500
        fFeatures.put(SCHEMA_AUGMENT_PSVI, Boolean.TRUE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   501
        fFeatures.put(GENERATE_SYNTHETIC_ANNOTATIONS, Boolean.FALSE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   502
        fFeatures.put(VALIDATE_ANNOTATIONS, Boolean.FALSE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   503
        fFeatures.put(HONOUR_ALL_SCHEMALOCATIONS, Boolean.FALSE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   504
        fFeatures.put(NAMESPACE_GROWTH, Boolean.FALSE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   505
        fFeatures.put(TOLERATE_DUPLICATES, Boolean.FALSE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   506
        fFeatures.put(USE_GRAMMAR_POOL_ONLY, Boolean.FALSE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   507
        fFeatures.put(PARSER_SETTINGS, Boolean.TRUE);
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   508
        fFeatures.put(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE);
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   509
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   510
        // add default recognized properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   511
        final String[] recognizedProperties =
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   512
            {
20963
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   513
                                SYMBOL_TABLE,
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   514
                                ERROR_HANDLER,
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   515
                                ENTITY_RESOLVER,
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   516
                ERROR_REPORTER,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   517
                ENTITY_MANAGER,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   518
                DOCUMENT_SCANNER,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   519
                DTD_SCANNER,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   520
                DTD_PROCESSOR,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   521
                DTD_VALIDATOR,
20963
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   522
                                DATATYPE_VALIDATOR_FACTORY,
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   523
                                VALIDATION_MANAGER,
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   524
                                SCHEMA_VALIDATOR,
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   525
                                XML_STRING,
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   526
                XMLGRAMMAR_POOL,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   527
                JAXP_SCHEMA_SOURCE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   528
                JAXP_SCHEMA_LANGUAGE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   529
                // NOTE: These shouldn't really be here but since the XML Schema
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   530
                //       validator is constructed dynamically, its recognized
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   531
                //       properties might not have been set and it would cause a
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   532
                //       not-recognized exception to be thrown. -Ac
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   533
                SCHEMA_LOCATION,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   534
                SCHEMA_NONS_LOCATION,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   535
                LOCALE,
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   536
                SCHEMA_DV_FACTORY,
20968
dde41f8b7b96 8014530: Better digital signature processing
joehw
parents: 20967
diff changeset
   537
                SECURITY_MANAGER,
18890
25bdeca3173b 8016648: FEATURE_SECURE_PROCESSING set to true or false causes SAXParseException to be thrown
joehw
parents: 17534
diff changeset
   538
                XML_SECURITY_PROPERTY_MANAGER
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   539
        };
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   540
        addRecognizedProperties(recognizedProperties);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   541
20963
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   542
                if (symbolTable == null) {
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   543
                        symbolTable = new SymbolTable();
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   544
                }
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   545
                fSymbolTable = symbolTable;
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   546
                fProperties.put(SYMBOL_TABLE, fSymbolTable);
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   547
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   548
        fGrammarPool = grammarPool;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   549
        if (fGrammarPool != null) {
20963
b38e478f8c65 8012425: Transform TransformerFactory
joehw
parents: 17534
diff changeset
   550
                        fProperties.put(XMLGRAMMAR_POOL, fGrammarPool);
12005
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   551
        }
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
        fEntityManager = new XMLEntityManager();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   554
                fProperties.put(ENTITY_MANAGER, fEntityManager);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   555
        addCommonComponent(fEntityManager);
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
        fErrorReporter = new XMLErrorReporter();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   558
        fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   559
                fProperties.put(ERROR_REPORTER, fErrorReporter);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   560
        addCommonComponent(fErrorReporter);
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
        fNamespaceScanner = new XMLNSDocumentScannerImpl();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   563
                fProperties.put(DOCUMENT_SCANNER, fNamespaceScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   564
        addComponent((XMLComponent) fNamespaceScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   565
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   566
        fDTDScanner = new XMLDTDScannerImpl();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   567
                fProperties.put(DTD_SCANNER, fDTDScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   568
        addComponent((XMLComponent) fDTDScanner);
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
        fDTDProcessor = new XMLDTDProcessor();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   571
                fProperties.put(DTD_PROCESSOR, fDTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   572
        addComponent((XMLComponent) fDTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   573
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   574
        fDTDValidator = new XMLNSDTDValidator();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   575
                fProperties.put(DTD_VALIDATOR, fDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   576
        addComponent(fDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   577
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   578
        fDatatypeValidatorFactory = DTDDVFactory.getInstance();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   579
                fProperties.put(DATATYPE_VALIDATOR_FACTORY, fDatatypeValidatorFactory);
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
        fValidationManager = new ValidationManager();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   582
                fProperties.put(VALIDATION_MANAGER, fValidationManager);
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
        fVersionDetector = new XMLVersionDetector();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   585
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   586
        // add message formatters
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   587
        if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   588
            XMLMessageFormatter xmft = new XMLMessageFormatter();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   589
            fErrorReporter.putMessageFormatter(XMLMessageFormatter.XML_DOMAIN, xmft);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   590
            fErrorReporter.putMessageFormatter(XMLMessageFormatter.XMLNS_DOMAIN, xmft);
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
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   593
        // set locale
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   594
        try {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   595
            setLocale(Locale.getDefault());
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   596
        } catch (XNIException e) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   597
            // do nothing
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   598
            // REVISIT: What is the right thing to do? -Ac
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
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   601
                fConfigUpdated = false;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   602
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   603
    } // <init>(SymbolTable,XMLGrammarPool)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   604
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
    // Public methods
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
     * Sets the input source for the document to parse.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   610
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   611
     * @param inputSource The document's input source.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   612
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   613
     * @exception XMLConfigurationException Thrown if there is a
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   614
     *                        configuration error when initializing the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   615
     *                        parser.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   616
     * @exception IOException Thrown on I/O error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   617
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   618
     * @see #parse(boolean)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   619
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   620
    public void setInputSource(XMLInputSource inputSource)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   621
        throws XMLConfigurationException, IOException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   622
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   623
        // REVISIT: this method used to reset all the components and
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   624
        //          construct the pipeline. Now reset() is called
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   625
        //          in parse (boolean) just before we parse the document
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   626
        //          Should this method still throw exceptions..?
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
        fInputSource = inputSource;
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
    } // setInputSource(XMLInputSource)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   631
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
     * Set the locale to use for messages.
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
     * @param locale The locale object to use for localization of messages.
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
     * @exception XNIException Thrown if the parser does not support the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   638
     *                         specified locale.
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
    public void setLocale(Locale locale) throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   641
        fLocale = locale;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   642
        fErrorReporter.setLocale(locale);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   643
    } // setLocale(Locale)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   644
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   645
         * Sets the document handler on the last component in the pipeline
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   646
         * to receive information about the document.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   647
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   648
         * @param documentHandler   The document handler.
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
        public void setDocumentHandler(XMLDocumentHandler documentHandler) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   651
                fDocumentHandler = documentHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   652
                if (fLastComponent != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   653
                        fLastComponent.setDocumentHandler(fDocumentHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   654
                        if (fDocumentHandler !=null){
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   655
                                fDocumentHandler.setDocumentSource(fLastComponent);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   656
                        }
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
        } // setDocumentHandler(XMLDocumentHandler)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   659
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   660
        /** Returns the registered document handler. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   661
        public XMLDocumentHandler getDocumentHandler() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   662
                return fDocumentHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   663
        } // getDocumentHandler():XMLDocumentHandler
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   664
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   665
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   666
         * Sets the DTD handler.
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
         * @param dtdHandler The DTD handler.
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
        public void setDTDHandler(XMLDTDHandler dtdHandler) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   671
                fDTDHandler = dtdHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   672
        } // setDTDHandler(XMLDTDHandler)
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
        /** Returns the registered DTD handler. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   675
        public XMLDTDHandler getDTDHandler() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   676
                return fDTDHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   677
        } // getDTDHandler():XMLDTDHandler
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   678
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
         * Sets the DTD content model handler.
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
         * @param handler The DTD content model handler.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   683
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   684
        public void setDTDContentModelHandler(XMLDTDContentModelHandler handler) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   685
                fDTDContentModelHandler = handler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   686
        } // setDTDContentModelHandler(XMLDTDContentModelHandler)
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
        /** Returns the registered DTD content model handler. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   689
        public XMLDTDContentModelHandler getDTDContentModelHandler() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   690
                return fDTDContentModelHandler;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   691
        } // getDTDContentModelHandler():XMLDTDContentModelHandler
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   692
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
         * Sets the resolver used to resolve external entities. The EntityResolver
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   695
         * interface supports resolution of public and system identifiers.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   696
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   697
         * @param resolver The new entity resolver. Passing a null value will
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   698
         *                 uninstall the currently installed resolver.
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
        public void setEntityResolver(XMLEntityResolver resolver) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   701
                fProperties.put(ENTITY_RESOLVER, resolver);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   702
        } // setEntityResolver(XMLEntityResolver)
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
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   705
         * Return the current entity resolver.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   706
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   707
         * @return The current entity resolver, or null if none
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   708
         *         has been registered.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   709
         * @see #setEntityResolver
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   710
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   711
        public XMLEntityResolver getEntityResolver() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   712
                return (XMLEntityResolver)fProperties.get(ENTITY_RESOLVER);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   713
        } // getEntityResolver():XMLEntityResolver
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   714
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   715
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   716
         * Allow an application to register an error event handler.
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
         * <p>If the application does not register an error handler, all
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   719
         * error events reported by the SAX parser will be silently
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   720
         * ignored; however, normal processing may not continue.  It is
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   721
         * highly recommended that all SAX applications implement an
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   722
         * error handler to avoid unexpected bugs.</p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   723
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   724
         * <p>Applications may register a new or different handler in the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   725
         * middle of a parse, and the SAX parser must begin using the new
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   726
         * handler immediately.</p>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   727
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   728
         * @param errorHandler The error handler.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   729
         * @exception java.lang.NullPointerException If the handler
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   730
         *            argument is null.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   731
         * @see #getErrorHandler
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   732
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   733
        public void setErrorHandler(XMLErrorHandler errorHandler) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   734
                fProperties.put(ERROR_HANDLER, errorHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   735
        } // setErrorHandler(XMLErrorHandler)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   736
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   737
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   738
         * Return the current error handler.
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
         * @return The current error handler, or null if none
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   741
         *         has been registered.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   742
         * @see #setErrorHandler
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   743
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   744
        public XMLErrorHandler getErrorHandler() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   745
                // REVISIT: Should this be a property?
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   746
                return (XMLErrorHandler)fProperties.get(ERROR_HANDLER);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   747
        } // getErrorHandler():XMLErrorHandler
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   748
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   749
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   750
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   751
     * If the application decides to terminate parsing before the xml document
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   752
     * is fully parsed, the application should call this method to free any
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   753
     * resource allocated during parsing. For example, close all opened streams.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   754
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   755
    public void cleanup() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   756
        fEntityManager.closeReaders();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   757
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   758
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   759
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   760
     * Parses the specified input source.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   761
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   762
     * @param source The input source.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   763
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   764
     * @exception XNIException Throws exception on XNI error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   765
     * @exception java.io.IOException Throws exception on i/o error.
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
    public void parse(XMLInputSource source) throws XNIException, IOException {
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
        if (fParseInProgress) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   770
            // REVISIT - need to add new error message
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   771
            throw new XNIException("FWK005 parse may not be called while parsing.");
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   772
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   773
        fParseInProgress = true;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   774
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   775
        try {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   776
            setInputSource(source);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   777
            parse(true);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   778
        } catch (XNIException ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   779
            if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   780
                ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   781
            throw ex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   782
        } catch (IOException ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   783
            if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   784
                ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   785
            throw ex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   786
        } catch (RuntimeException ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   787
            if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   788
                ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   789
            throw ex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   790
        } catch (Exception ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   791
            if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   792
                ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   793
            throw new XNIException(ex);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   794
        } finally {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   795
            fParseInProgress = false;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   796
            // close all streams opened by xerces
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   797
            this.cleanup();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   798
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   799
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   800
    } // parse(InputSource)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   801
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   802
    public boolean parse(boolean complete) throws XNIException, IOException {
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
        // reset and configure pipeline and set InputSource.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   805
        if (fInputSource != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   806
            try {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   807
                fValidationManager.reset();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   808
                fVersionDetector.reset(this);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   809
                fConfigUpdated = true;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   810
                resetCommon();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   811
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   812
                short version = fVersionDetector.determineDocVersion(fInputSource);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   813
                if (version == Constants.XML_VERSION_1_1) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   814
                    initXML11Components();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   815
                    configureXML11Pipeline();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   816
                    resetXML11();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   817
                } else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   818
                    configurePipeline();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   819
                    reset();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   820
                }
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
                // mark configuration as fixed
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   823
                fConfigUpdated = false;
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
                // resets and sets the pipeline.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   826
                fVersionDetector.startDocumentParsing((XMLEntityHandler) fCurrentScanner, version);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   827
                fInputSource = null;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   828
            } catch (XNIException ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   829
                if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   830
                    ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   831
                throw ex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   832
            } catch (IOException ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   833
                if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   834
                    ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   835
                throw ex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   836
            } catch (RuntimeException ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   837
                if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   838
                    ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   839
                throw ex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   840
            } catch (Exception ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   841
                if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   842
                    ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   843
                throw new XNIException(ex);
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
        try {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   848
            return fCurrentScanner.scanDocument(complete);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   849
        } catch (XNIException ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   850
            if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   851
                ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   852
            throw ex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   853
        } catch (IOException ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   854
            if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   855
                ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   856
            throw ex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   857
        } catch (RuntimeException ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   858
            if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   859
                ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   860
            throw ex;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   861
        } catch (Exception ex) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   862
            if (PRINT_EXCEPTION_STACK_TRACE)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   863
                ex.printStackTrace();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   864
            throw new XNIException(ex);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   865
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   866
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   867
    } // parse(boolean):boolean
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   868
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
         * Returns the state of a feature.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   871
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   872
         * @param featureId The feature identifier.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   873
         * @return true if the feature is supported
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   874
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   875
         * @throws XMLConfigurationException Thrown for configuration error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   876
         *                                   In general, components should
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   877
         *                                   only throw this exception if
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   878
         *                                   it is <strong>really</strong>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   879
         *                                   a critical error.
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
        public FeatureState getFeatureState(String featureId)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   882
                throws XMLConfigurationException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   883
                        // make this feature special
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   884
        if (featureId.equals(PARSER_SETTINGS)){
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   885
                return FeatureState.is(fConfigUpdated);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   886
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   887
        return super.getFeatureState(featureId);
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
        } // getFeature(String):boolean
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   890
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   891
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   892
         * Set the state of a feature.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   893
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   894
         * Set the state of any feature in a SAX2 parser.  The parser
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   895
         * might not recognize the feature, and if it does recognize
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   896
         * it, it might not be able to fulfill the request.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   897
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   898
         * @param featureId The unique identifier (URI) of the feature.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   899
         * @param state The requested state of the feature (true or false).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   900
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   901
         * @exception com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException If the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   902
         *            requested feature is not known.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   903
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   904
        public void setFeature(String featureId, boolean state)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   905
                throws XMLConfigurationException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   906
                fConfigUpdated = true;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   907
                // forward to every XML 1.0 component
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   908
                int count = fComponents.size();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   909
                for (int i = 0; i < count; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   910
                        XMLComponent c = (XMLComponent) fComponents.get(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   911
                        c.setFeature(featureId, state);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   912
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   913
                // forward it to common components
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   914
                count = fCommonComponents.size();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   915
                for (int i = 0; i < count; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   916
                        XMLComponent c = (XMLComponent) fCommonComponents.get(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   917
                        c.setFeature(featureId, state);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   918
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   919
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   920
                // forward to every XML 1.1 component
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   921
                count = fXML11Components.size();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   922
                for (int i = 0; i < count; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   923
                        XMLComponent c = (XMLComponent) fXML11Components.get(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   924
                        try{
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   925
                                c.setFeature(featureId, state);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   926
                        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   927
                        catch (Exception e){
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   928
                                // no op
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   929
                        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   930
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   931
                // save state if noone "objects"
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   932
                super.setFeature(featureId, state);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   933
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   934
        } // setFeature(String,boolean)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   935
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   936
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   937
     * Returns the value of a property.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   938
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   939
     * @param propertyId The property identifier.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   940
     * @return the value of the property
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   941
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   942
     * @throws XMLConfigurationException Thrown for configuration error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   943
     *                                   In general, components should
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   944
     *                                   only throw this exception if
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   945
     *                                   it is <strong>really</strong>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   946
     *                                   a critical error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   947
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   948
    public PropertyState getPropertyState(String propertyId)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   949
        throws XMLConfigurationException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   950
        if (LOCALE.equals(propertyId)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   951
            return PropertyState.is(getLocale());
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   952
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   953
        return super.getPropertyState(propertyId);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   954
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   955
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   956
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   957
         * setProperty
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   958
         *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   959
         * @param propertyId
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   960
         * @param value
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   961
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   962
        public void setProperty(String propertyId, Object value)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   963
                throws XMLConfigurationException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   964
                fConfigUpdated = true;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   965
                if (LOCALE.equals(propertyId)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   966
                    setLocale((Locale) value);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   967
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   968
                // forward to every XML 1.0 component
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   969
                int count = fComponents.size();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   970
                for (int i = 0; i < count; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   971
                        XMLComponent c = (XMLComponent) fComponents.get(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   972
                        c.setProperty(propertyId, value);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   973
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   974
                // forward it to every common Component
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   975
                count = fCommonComponents.size();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   976
                for (int i = 0; i < count; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   977
                        XMLComponent c = (XMLComponent) fCommonComponents.get(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   978
                        c.setProperty(propertyId, value);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   979
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   980
                // forward it to every XML 1.1 component
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   981
                count = fXML11Components.size();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   982
                for (int i = 0; i < count; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   983
                        XMLComponent c = (XMLComponent) fXML11Components.get(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   984
                        try{
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   985
                                c.setProperty(propertyId, value);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   986
                        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   987
                        catch (Exception e){
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   988
                                // ignore it
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   989
                        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   990
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   991
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   992
                // store value if noone "objects"
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   993
                super.setProperty(propertyId, value);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   994
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   995
        } // setProperty(String,Object)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   996
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   997
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   998
        /** Returns the locale. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
   999
        public Locale getLocale() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1000
                return fLocale;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1001
        } // getLocale():Locale
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1002
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1003
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1004
         * reset all XML 1.0 components before parsing and namespace context
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1005
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1006
        protected void reset() throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1007
                int count = fComponents.size();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1008
                for (int i = 0; i < count; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1009
                        XMLComponent c = (XMLComponent) fComponents.get(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1010
                        c.reset(this);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1011
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1012
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1013
        } // reset()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1014
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1015
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1016
         * reset all common components before parsing
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1017
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1018
        protected void resetCommon() throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1019
                // reset common components
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1020
                int count = fCommonComponents.size();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1021
                for (int i = 0; i < count; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1022
                        XMLComponent c = (XMLComponent) fCommonComponents.get(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1023
                        c.reset(this);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1024
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1025
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1026
        } // resetCommon()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1027
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1028
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1029
        /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1030
         * reset all components before parsing and namespace context
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1031
         */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1032
        protected void resetXML11() throws XNIException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1033
                // reset every component
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1034
                int count = fXML11Components.size();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1035
                for (int i = 0; i < count; i++) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1036
                        XMLComponent c = (XMLComponent) fXML11Components.get(i);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1037
                        c.reset(this);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1038
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1039
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1040
        } // resetXML11()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1041
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1042
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1043
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1044
     *  Configures the XML 1.1 pipeline.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1045
     *  Note: this method also resets the new XML11 components.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1046
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1047
    protected void configureXML11Pipeline() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1048
        if (fCurrentDVFactory != fXML11DatatypeFactory) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1049
            fCurrentDVFactory = fXML11DatatypeFactory;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1050
            setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1051
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1052
        if (fCurrentDTDScanner != fXML11DTDScanner) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1053
            fCurrentDTDScanner = fXML11DTDScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1054
            setProperty(DTD_SCANNER, fCurrentDTDScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1055
                        setProperty(DTD_PROCESSOR, fXML11DTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1056
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1057
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1058
        fXML11DTDScanner.setDTDHandler(fXML11DTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1059
        fXML11DTDProcessor.setDTDSource(fXML11DTDScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1060
        fXML11DTDProcessor.setDTDHandler(fDTDHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1061
        if (fDTDHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1062
            fDTDHandler.setDTDSource(fXML11DTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1063
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1064
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1065
        fXML11DTDScanner.setDTDContentModelHandler(fXML11DTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1066
        fXML11DTDProcessor.setDTDContentModelSource(fXML11DTDScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1067
        fXML11DTDProcessor.setDTDContentModelHandler(fDTDContentModelHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1068
        if (fDTDContentModelHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1069
            fDTDContentModelHandler.setDTDContentModelSource(fXML11DTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1070
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1071
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1072
        // setup XML 1.1 document pipeline
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1073
        if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1074
            if (fCurrentScanner != fXML11NSDocScanner) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1075
                fCurrentScanner = fXML11NSDocScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1076
                setProperty(DOCUMENT_SCANNER, fXML11NSDocScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1077
                setProperty(DTD_VALIDATOR, fXML11NSDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1078
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1079
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1080
            fXML11NSDocScanner.setDTDValidator(fXML11NSDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1081
            fXML11NSDocScanner.setDocumentHandler(fXML11NSDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1082
            fXML11NSDTDValidator.setDocumentSource(fXML11NSDocScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1083
            fXML11NSDTDValidator.setDocumentHandler(fDocumentHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1084
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1085
            if (fDocumentHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1086
                fDocumentHandler.setDocumentSource(fXML11NSDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1087
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1088
            fLastComponent = fXML11NSDTDValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1089
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1090
        } else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1091
                        // create components
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1092
                          if (fXML11DocScanner == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1093
                                        // non namespace document pipeline
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1094
                                        fXML11DocScanner = new XML11DocumentScannerImpl();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1095
                                        addXML11Component(fXML11DocScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1096
                                        fXML11DTDValidator = new XML11DTDValidator();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1097
                                        addXML11Component(fXML11DTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1098
                          }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1099
            if (fCurrentScanner != fXML11DocScanner) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1100
                fCurrentScanner = fXML11DocScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1101
                setProperty(DOCUMENT_SCANNER, fXML11DocScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1102
                setProperty(DTD_VALIDATOR, fXML11DTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1103
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1104
            fXML11DocScanner.setDocumentHandler(fXML11DTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1105
            fXML11DTDValidator.setDocumentSource(fXML11DocScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1106
            fXML11DTDValidator.setDocumentHandler(fDocumentHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1107
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1108
            if (fDocumentHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1109
                fDocumentHandler.setDocumentSource(fXML11DTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1110
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1111
            fLastComponent = fXML11DTDValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1112
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1113
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1114
        // setup document pipeline
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1115
        if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1116
            // If schema validator was not in the pipeline insert it.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1117
            if (fSchemaValidator == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1118
                fSchemaValidator = new XMLSchemaValidator();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1119
                // add schema component
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1120
                setProperty(SCHEMA_VALIDATOR, fSchemaValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1121
                                addCommonComponent(fSchemaValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1122
                                fSchemaValidator.reset(this);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1123
                // add schema message formatter
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1124
                if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1125
                    XSMessageFormatter xmft = new XSMessageFormatter();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1126
                    fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, xmft);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1127
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1128
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1129
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1130
            fLastComponent.setDocumentHandler(fSchemaValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1131
            fSchemaValidator.setDocumentSource(fLastComponent);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1132
            fSchemaValidator.setDocumentHandler(fDocumentHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1133
            if (fDocumentHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1134
                fDocumentHandler.setDocumentSource(fSchemaValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1135
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1136
            fLastComponent = fSchemaValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1137
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1138
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1139
    } // configureXML11Pipeline()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1140
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1141
    /** Configures the pipeline. */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1142
    protected void configurePipeline() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1143
        if (fCurrentDVFactory != fDatatypeValidatorFactory) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1144
            fCurrentDVFactory = fDatatypeValidatorFactory;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1145
            // use XML 1.0 datatype library
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1146
            setProperty(DATATYPE_VALIDATOR_FACTORY, fCurrentDVFactory);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1147
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1148
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1149
        // setup DTD pipeline
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1150
        if (fCurrentDTDScanner != fDTDScanner) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1151
            fCurrentDTDScanner = fDTDScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1152
            setProperty(DTD_SCANNER, fCurrentDTDScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1153
            setProperty(DTD_PROCESSOR, fDTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1154
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1155
        fDTDScanner.setDTDHandler(fDTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1156
        fDTDProcessor.setDTDSource(fDTDScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1157
        fDTDProcessor.setDTDHandler(fDTDHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1158
        if (fDTDHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1159
            fDTDHandler.setDTDSource(fDTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1160
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1161
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1162
        fDTDScanner.setDTDContentModelHandler(fDTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1163
        fDTDProcessor.setDTDContentModelSource(fDTDScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1164
        fDTDProcessor.setDTDContentModelHandler(fDTDContentModelHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1165
        if (fDTDContentModelHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1166
            fDTDContentModelHandler.setDTDContentModelSource(fDTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1167
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1168
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1169
        // setup document pipeline
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1170
        if (fFeatures.get(NAMESPACES) == Boolean.TRUE) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1171
            if (fCurrentScanner != fNamespaceScanner) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1172
                fCurrentScanner = fNamespaceScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1173
                setProperty(DOCUMENT_SCANNER, fNamespaceScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1174
                setProperty(DTD_VALIDATOR, fDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1175
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1176
            fNamespaceScanner.setDTDValidator(fDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1177
            fNamespaceScanner.setDocumentHandler(fDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1178
            fDTDValidator.setDocumentSource(fNamespaceScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1179
            fDTDValidator.setDocumentHandler(fDocumentHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1180
            if (fDocumentHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1181
                fDocumentHandler.setDocumentSource(fDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1182
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1183
            fLastComponent = fDTDValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1184
        } else {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1185
            // create components
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1186
            if (fNonNSScanner == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1187
                fNonNSScanner = new XMLDocumentScannerImpl();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1188
                fNonNSDTDValidator = new XMLDTDValidator();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1189
                // add components
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1190
                addComponent((XMLComponent) fNonNSScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1191
                addComponent((XMLComponent) fNonNSDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1192
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1193
            if (fCurrentScanner != fNonNSScanner) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1194
                fCurrentScanner = fNonNSScanner;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1195
                setProperty(DOCUMENT_SCANNER, fNonNSScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1196
                setProperty(DTD_VALIDATOR, fNonNSDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1197
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1198
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1199
            fNonNSScanner.setDocumentHandler(fNonNSDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1200
            fNonNSDTDValidator.setDocumentSource(fNonNSScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1201
            fNonNSDTDValidator.setDocumentHandler(fDocumentHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1202
            if (fDocumentHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1203
                fDocumentHandler.setDocumentSource(fNonNSDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1204
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1205
            fLastComponent = fNonNSDTDValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1206
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1207
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1208
        // add XML Schema validator if needed
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1209
        if (fFeatures.get(XMLSCHEMA_VALIDATION) == Boolean.TRUE) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1210
            // If schema validator was not in the pipeline insert it.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1211
            if (fSchemaValidator == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1212
                fSchemaValidator = new XMLSchemaValidator();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1213
                // add schema component
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1214
                setProperty(SCHEMA_VALIDATOR, fSchemaValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1215
                addCommonComponent(fSchemaValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1216
                fSchemaValidator.reset(this);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1217
                // add schema message formatter
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1218
                if (fErrorReporter.getMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN) == null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1219
                    XSMessageFormatter xmft = new XSMessageFormatter();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1220
                    fErrorReporter.putMessageFormatter(XSMessageFormatter.SCHEMA_DOMAIN, xmft);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1221
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1222
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1223
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1224
            fLastComponent.setDocumentHandler(fSchemaValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1225
            fSchemaValidator.setDocumentSource(fLastComponent);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1226
            fSchemaValidator.setDocumentHandler(fDocumentHandler);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1227
            if (fDocumentHandler != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1228
                fDocumentHandler.setDocumentSource(fSchemaValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1229
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1230
            fLastComponent = fSchemaValidator;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1231
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1232
    } // configurePipeline()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1233
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1234
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1235
    // features and properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1236
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1237
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1238
     * Check a feature. If feature is know and supported, this method simply
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1239
     * returns. Otherwise, the appropriate exception is thrown.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1240
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1241
     * @param featureId The unique identifier (URI) of the feature.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1242
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1243
     * @throws XMLConfigurationException Thrown for configuration error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1244
     *                                   In general, components should
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1245
     *                                   only throw this exception if
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1246
     *                                   it is <strong>really</strong>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1247
     *                                   a critical error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1248
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1249
    protected FeatureState checkFeature(String featureId) throws XMLConfigurationException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1250
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1251
        //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1252
        // Xerces Features
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1253
        //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1254
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1255
        if (featureId.startsWith(Constants.XERCES_FEATURE_PREFIX)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1256
            final int suffixLength = featureId.length() - Constants.XERCES_FEATURE_PREFIX.length();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1257
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1258
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1259
            // http://apache.org/xml/features/validation/dynamic
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1260
            //   Allows the parser to validate a document only when it
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1261
            //   contains a grammar. Validation is turned on/off based
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1262
            //   on each document instance, automatically.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1263
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1264
            if (suffixLength == Constants.DYNAMIC_VALIDATION_FEATURE.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1265
                featureId.endsWith(Constants.DYNAMIC_VALIDATION_FEATURE)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1266
                return FeatureState.RECOGNIZED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1267
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1268
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1269
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1270
            // http://apache.org/xml/features/validation/default-attribute-values
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1271
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1272
            if (suffixLength == Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1273
                featureId.endsWith(Constants.DEFAULT_ATTRIBUTE_VALUES_FEATURE)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1274
                // REVISIT
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1275
                return FeatureState.NOT_SUPPORTED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1276
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1277
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1278
            // http://apache.org/xml/features/validation/default-attribute-values
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1279
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1280
            if (suffixLength == Constants.VALIDATE_CONTENT_MODELS_FEATURE.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1281
                featureId.endsWith(Constants.VALIDATE_CONTENT_MODELS_FEATURE)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1282
                // REVISIT
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1283
                return FeatureState.NOT_SUPPORTED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1284
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1285
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1286
            // http://apache.org/xml/features/validation/nonvalidating/load-dtd-grammar
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1287
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1288
            if (suffixLength == Constants.LOAD_DTD_GRAMMAR_FEATURE.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1289
                featureId.endsWith(Constants.LOAD_DTD_GRAMMAR_FEATURE)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1290
                return FeatureState.RECOGNIZED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1291
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1292
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1293
            // http://apache.org/xml/features/validation/nonvalidating/load-external-dtd
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1294
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1295
            if (suffixLength == Constants.LOAD_EXTERNAL_DTD_FEATURE.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1296
                featureId.endsWith(Constants.LOAD_EXTERNAL_DTD_FEATURE)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1297
                return FeatureState.RECOGNIZED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1298
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1299
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1300
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1301
            // http://apache.org/xml/features/validation/default-attribute-values
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1302
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1303
            if (suffixLength == Constants.VALIDATE_DATATYPES_FEATURE.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1304
                featureId.endsWith(Constants.VALIDATE_DATATYPES_FEATURE)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1305
                return FeatureState.NOT_SUPPORTED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1306
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1307
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1308
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1309
            // http://apache.org/xml/features/validation/schema
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1310
            //   Lets the user turn Schema validation support on/off.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1311
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1312
            if (suffixLength == Constants.SCHEMA_VALIDATION_FEATURE.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1313
                featureId.endsWith(Constants.SCHEMA_VALIDATION_FEATURE)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1314
                return FeatureState.RECOGNIZED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1315
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1316
            // activate full schema checking
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1317
            if (suffixLength == Constants.SCHEMA_FULL_CHECKING.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1318
                featureId.endsWith(Constants.SCHEMA_FULL_CHECKING)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1319
                return FeatureState.RECOGNIZED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1320
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1321
            // Feature identifier: expose schema normalized value
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1322
            //  http://apache.org/xml/features/validation/schema/normalized-value
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1323
            if (suffixLength == Constants.SCHEMA_NORMALIZED_VALUE.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1324
                featureId.endsWith(Constants.SCHEMA_NORMALIZED_VALUE)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1325
                return FeatureState.RECOGNIZED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1326
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1327
            // Feature identifier: send element default value via characters()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1328
            // http://apache.org/xml/features/validation/schema/element-default
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1329
            if (suffixLength == Constants.SCHEMA_ELEMENT_DEFAULT.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1330
                featureId.endsWith(Constants.SCHEMA_ELEMENT_DEFAULT)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1331
                return FeatureState.RECOGNIZED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1332
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1333
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1334
            // special performance feature: only component manager is allowed to set it.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1335
            if (suffixLength == Constants.PARSER_SETTINGS.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1336
                featureId.endsWith(Constants.PARSER_SETTINGS)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1337
                return FeatureState.NOT_SUPPORTED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1338
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1339
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1340
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1341
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1342
        //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1343
        // Not recognized
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1344
        //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1345
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1346
        return super.checkFeature(featureId);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1347
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1348
    } // checkFeature(String)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1349
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1350
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1351
     * Check a property. If the property is know and supported, this method
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1352
     * simply returns. Otherwise, the appropriate exception is thrown.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1353
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1354
     * @param propertyId The unique identifier (URI) of the property
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1355
     *                   being set.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1356
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1357
     * @throws XMLConfigurationException Thrown for configuration error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1358
     *                                   In general, components should
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1359
     *                                   only throw this exception if
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1360
     *                                   it is <strong>really</strong>
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1361
     *                                   a critical error.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1362
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1363
    protected PropertyState checkProperty(String propertyId) throws XMLConfigurationException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1364
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1365
        //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1366
        // Xerces Properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1367
        //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1368
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1369
        if (propertyId.startsWith(Constants.XERCES_PROPERTY_PREFIX)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1370
            final int suffixLength = propertyId.length() - Constants.XERCES_PROPERTY_PREFIX.length();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1371
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1372
            if (suffixLength == Constants.DTD_SCANNER_PROPERTY.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1373
                propertyId.endsWith(Constants.DTD_SCANNER_PROPERTY)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1374
                return PropertyState.RECOGNIZED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1375
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1376
            if (suffixLength == Constants.SCHEMA_LOCATION.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1377
                propertyId.endsWith(Constants.SCHEMA_LOCATION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1378
                return PropertyState.RECOGNIZED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1379
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1380
            if (suffixLength == Constants.SCHEMA_NONS_LOCATION.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1381
                propertyId.endsWith(Constants.SCHEMA_NONS_LOCATION)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1382
                return PropertyState.RECOGNIZED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1383
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1384
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1385
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1386
        if (propertyId.startsWith(Constants.JAXP_PROPERTY_PREFIX)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1387
            final int suffixLength = propertyId.length() - Constants.JAXP_PROPERTY_PREFIX.length();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1388
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1389
            if (suffixLength == Constants.SCHEMA_SOURCE.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1390
                propertyId.endsWith(Constants.SCHEMA_SOURCE)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1391
                return PropertyState.RECOGNIZED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1392
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1393
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1394
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1395
        // special cases
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1396
        if (propertyId.startsWith(Constants.SAX_PROPERTY_PREFIX)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1397
            final int suffixLength = propertyId.length() - Constants.SAX_PROPERTY_PREFIX.length();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1398
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1399
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1400
            // http://xml.org/sax/properties/xml-string
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1401
            // Value type: String
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1402
            // Access: read-only
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1403
            //   Get the literal string of characters associated with the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1404
            //   current event.  If the parser recognises and supports this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1405
            //   property but is not currently parsing text, it should return
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1406
            //   null (this is a good way to check for availability before the
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1407
            //   parse begins).
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1408
            //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1409
            if (suffixLength == Constants.XML_STRING_PROPERTY.length() &&
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1410
                propertyId.endsWith(Constants.XML_STRING_PROPERTY)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1411
                // REVISIT - we should probably ask xml-dev for a precise
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1412
                // definition of what this is actually supposed to return, and
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1413
                // in exactly which circumstances.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1414
                return PropertyState.NOT_SUPPORTED;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1415
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1416
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1417
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1418
        //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1419
        // Not recognized
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1420
        //
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1421
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1422
        return super.checkProperty(propertyId);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1423
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1424
    } // checkProperty(String)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1425
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1426
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1427
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1428
     * Adds a component to the parser configuration. This method will
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1429
     * also add all of the component's recognized features and properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1430
     * to the list of default recognized features and properties.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1431
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1432
     * @param component The component to add.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1433
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1434
    protected void addComponent(XMLComponent component) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1435
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1436
        // don't add a component more than once
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1437
        if (fComponents.contains(component)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1438
            return;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1439
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1440
        fComponents.add(component);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1441
        addRecognizedParamsAndSetDefaults(component);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1442
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1443
    } // addComponent(XMLComponent)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1444
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1445
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1446
     * Adds common component to the parser configuration. This method will
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1447
     * also add all of the component's recognized features and properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1448
     * to the list of default recognized features and properties.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1449
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1450
     * @param component The component to add.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1451
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1452
    protected void addCommonComponent(XMLComponent component) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1453
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1454
        // don't add a component more than once
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1455
        if (fCommonComponents.contains(component)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1456
            return;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1457
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1458
        fCommonComponents.add(component);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1459
        addRecognizedParamsAndSetDefaults(component);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1460
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1461
    } // addCommonComponent(XMLComponent)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1462
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1463
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1464
     * Adds an XML 1.1 component to the parser configuration. This method will
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1465
     * also add all of the component's recognized features and properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1466
     * to the list of default recognized features and properties.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1467
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1468
     * @param component The component to add.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1469
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1470
    protected void addXML11Component(XMLComponent component) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1471
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1472
        // don't add a component more than once
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1473
        if (fXML11Components.contains(component)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1474
            return;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1475
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1476
        fXML11Components.add(component);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1477
        addRecognizedParamsAndSetDefaults(component);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1478
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1479
    } // addXML11Component(XMLComponent)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1480
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1481
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1482
     * Adds all of the component's recognized features and properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1483
     * to the list of default recognized features and properties, and
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1484
     * sets default values on the configuration for features and
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1485
     * properties which were previously absent from the configuration.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1486
     *
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1487
     * @param component The component whose recognized features
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1488
     * and properties will be added to the configuration
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1489
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1490
    protected void addRecognizedParamsAndSetDefaults(XMLComponent component) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1491
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1492
        // register component's recognized features
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1493
        String[] recognizedFeatures = component.getRecognizedFeatures();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1494
        addRecognizedFeatures(recognizedFeatures);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1495
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1496
        // register component's recognized properties
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1497
        String[] recognizedProperties = component.getRecognizedProperties();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1498
        addRecognizedProperties(recognizedProperties);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1499
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1500
        // set default values
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1501
        if (recognizedFeatures != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1502
            for (int i = 0; i < recognizedFeatures.length; ++i) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1503
                String featureId = recognizedFeatures[i];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1504
                Boolean state = component.getFeatureDefault(featureId);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1505
                if (state != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1506
                    // Do not overwrite values already set on the configuration.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1507
                    if (!fFeatures.containsKey(featureId)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1508
                        fFeatures.put(featureId, state);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1509
                        // For newly added components who recognize this feature
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1510
                        // but did not offer a default value, we need to make
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1511
                        // sure these components will get an opportunity to read
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1512
                        // the value before parsing begins.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1513
                        fConfigUpdated = true;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1514
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1515
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1516
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1517
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1518
        if (recognizedProperties != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1519
            for (int i = 0; i < recognizedProperties.length; ++i) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1520
                String propertyId = recognizedProperties[i];
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1521
                Object value = component.getPropertyDefault(propertyId);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1522
                if (value != null) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1523
                    // Do not overwrite values already set on the configuration.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1524
                    if (!fProperties.containsKey(propertyId)) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1525
                        fProperties.put(propertyId, value);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1526
                        // For newly added components who recognize this property
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1527
                        // but did not offer a default value, we need to make
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1528
                        // sure these components will get an opportunity to read
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1529
                        // the value before parsing begins.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1530
                        fConfigUpdated = true;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1531
                    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1532
                }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1533
            }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1534
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1535
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1536
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1537
    private void initXML11Components() {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1538
        if (!f11Initialized) {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1539
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1540
            // create datatype factory
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1541
            fXML11DatatypeFactory = DTDDVFactory.getInstance(XML11_DATATYPE_VALIDATOR_FACTORY);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1542
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1543
            // setup XML 1.1 DTD pipeline
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1544
            fXML11DTDScanner = new XML11DTDScannerImpl();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1545
            addXML11Component(fXML11DTDScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1546
            fXML11DTDProcessor = new XML11DTDProcessor();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1547
            addXML11Component(fXML11DTDProcessor);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1548
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1549
            // setup XML 1.1. document pipeline - namespace aware
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1550
            fXML11NSDocScanner = new XML11NSDocumentScannerImpl();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1551
            addXML11Component(fXML11NSDocScanner);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1552
            fXML11NSDTDValidator = new XML11NSDTDValidator();
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1553
            addXML11Component(fXML11NSDTDValidator);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1554
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1555
            f11Initialized = true;
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1556
        }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1557
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1558
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1559
    /**
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1560
     * Returns the state of a feature. This method calls getFeature()
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1561
     * on ParserConfigurationSettings, bypassing getFeature() on this
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1562
     * class.
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1563
     */
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1564
    FeatureState getFeatureState0(String featureId)
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1565
        throws XMLConfigurationException {
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1566
        return super.getFeatureState(featureId);
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1567
    }
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1568
a754d69d5e60 7150324: Stop using drop bundles in jaxp
ohair
parents:
diff changeset
  1569
} // class XML11Configuration