jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMManager.java
author joehw
Mon, 18 Feb 2013 11:33:35 -0800
changeset 16953 a44e04deb948
parent 12458 d601e4bba306
child 18352 a1e183c996d6
permissions -rw-r--r--
6657673: Issues with JAXP Reviewed-by: alanb, lancea, ahgross, mullan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * Copyright 1999-2004 The Apache Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * Licensed under the Apache License, Version 2.0 (the "License");
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * you may not use this file except in compliance with the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * You may obtain a copy of the License at
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 *     http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * $Id: DTMManager.java,v 1.2.4.1 2005/09/15 08:14:54 suresh_emailid Exp $
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
package com.sun.org.apache.xml.internal.dtm;
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
import com.sun.org.apache.xml.internal.res.XMLErrorResources;
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
import com.sun.org.apache.xml.internal.res.XMLMessages;
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
import com.sun.org.apache.xml.internal.utils.PrefixResolver;
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
import com.sun.org.apache.xml.internal.utils.XMLStringFactory;
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
    29
import com.sun.org.apache.xalan.internal.utils.ObjectFactory;
16953
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12458
diff changeset
    30
import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
 * A DTMManager instance can be used to create DTM and
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * DTMIterator objects, and manage the DTM objects in the system.
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * <p>The system property that determines which Factory implementation
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 * to create is named "com.sun.org.apache.xml.internal.utils.DTMFactory". This
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * property names a concrete subclass of the DTMFactory abstract
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 *  class. If the property is not defined, a platform default is be used.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * <p>An instance of this class <emph>must</emph> be safe to use across
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * thread instances.  It is expected that a client will create a single instance
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * of a DTMManager to use across multiple threads.  This will allow sharing
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * of DTMs across multiple processes.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * <p>Note: this class is incomplete right now.  It will be pretty much
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * modeled after javax.xml.transform.TransformerFactory in terms of its
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * factory support.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * <p>State: In progress!!</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
public abstract class DTMManager
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
{
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
  /** The default property name to load the manager. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
  private static final String defaultPropName =
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
    "com.sun.org.apache.xml.internal.dtm.DTMManager";
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
  /** The default class name to use as the manager. */
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
  private static String defaultClassName =
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
    "com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault";
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
   * Factory for creating XMLString objects.
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
   *  %TBD% Make this set by the caller.
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
  protected XMLStringFactory m_xsf = null;
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
    69
  private boolean _useServicesMechanism;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
   * Default constructor is protected on purpose.
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
  protected DTMManager(){}
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
   * Get the XMLStringFactory used for the DTMs.
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
   * @return a valid XMLStringFactory object, or null if it hasn't been set yet.
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
  public XMLStringFactory getXMLStringFactory()
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
    return m_xsf;
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
   * Set the XMLStringFactory used for the DTMs.
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
   * @param xsf a valid XMLStringFactory object, should not be null.
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
  public void setXMLStringFactory(XMLStringFactory xsf)
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
    m_xsf = xsf;
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
   * Obtain a new instance of a <code>DTMManager</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
   * This static method creates a new factory instance
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
   * This method uses the following ordered lookup procedure to determine
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
   * the <code>DTMManager</code> implementation class to
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
   * load:
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
   * <ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
   * <li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
   * Use the <code>com.sun.org.apache.xml.internal.dtm.DTMManager</code> system
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
   * property.
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
   * </li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
   * <li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
   * Use the JAVA_HOME(the parent directory where jdk is
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
   * installed)/lib/xalan.properties for a property file that contains the
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
   * name of the implementation class keyed on the same value as the
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
   * system property defined above.
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
   * </li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
   * <li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
   * Use the Services API (as detailed in the JAR specification), if
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
   * available, to determine the classname. The Services API will look
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
   * for a classname in the file
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
   * <code>META-INF/services/com.sun.org.apache.xml.internal.dtm.DTMManager</code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
   * in jars available to the runtime.
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
   * </li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
   * <li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
   * Use the default <code>DTMManager</code> classname, which is
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
   * <code>com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
   * </li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
   * </ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
   * Once an application has obtained a reference to a <code>
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
   * DTMManager</code> it can use the factory to configure
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
   * and obtain parser instances.
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
   * @return new DTMManager instance, never null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
   * @throws DTMConfigurationException
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
   * if the implementation is not available or cannot be instantiated.
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
  public static DTMManager newInstance(XMLStringFactory xsf)
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
           throws DTMConfigurationException
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
  {
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   139
    return newInstance(xsf, true);
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   140
  }
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   141
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   142
  public static DTMManager newInstance(XMLStringFactory xsf, boolean useServicesMechanism)
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   143
           throws DTMConfigurationException
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   144
  {
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
    DTMManager factoryImpl = null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
    try
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
    {
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   148
        if (useServicesMechanism) {
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   149
            factoryImpl = (DTMManager) ObjectFactory
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   150
                .createObject(defaultPropName, defaultClassName);
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   151
        } else {
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   152
            factoryImpl = new com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault();
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   153
        }
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
    }
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   155
    catch (ConfigurationError e)
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
      throw new DTMConfigurationException(XMLMessages.createXMLMessage(
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
        XMLErrorResources.ER_NO_DEFAULT_IMPL, null), e.getException());
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
        //"No default implementation found");
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
    if (factoryImpl == null)
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
    {
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
      throw new DTMConfigurationException(XMLMessages.createXMLMessage(
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
        XMLErrorResources.ER_NO_DEFAULT_IMPL, null));
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
        //"No default implementation found");
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
    factoryImpl.setXMLStringFactory(xsf);
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
    return factoryImpl;
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
   * Get an instance of a DTM, loaded with the content from the
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
   * specified source.  If the unique flag is true, a new instance will
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
   * always be returned.  Otherwise it is up to the DTMManager to return a
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
   * new instance or an instance that it already created and may be being used
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
   * by someone else.
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
   * (More parameters may eventually need to be added for error handling
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
   * and entity resolution, and to better control selection of implementations.)
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
   * @param source the specification of the source object, which may be null,
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
   *               in which case it is assumed that node construction will take
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
   *               by some other means.
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
   * @param unique true if the returned DTM must be unique, probably because it
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
   * is going to be mutated.
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
   * @param whiteSpaceFilter Enables filtering of whitespace nodes, and may
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
   *                         be null.
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
   * @param incremental true if the DTM should be built incrementally, if
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
   *                    possible.
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
   * @param doIndexing true if the caller considers it worth it to use
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
   *                   indexing schemes.
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
   * @return a non-null DTM reference.
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
  public abstract DTM getDTM(javax.xml.transform.Source source,
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
                             boolean unique, DTMWSFilter whiteSpaceFilter,
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
                             boolean incremental, boolean doIndexing);
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
   * Get the instance of DTM that "owns" a node handle.
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
   * @param nodeHandle the nodeHandle.
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
   * @return a non-null DTM reference.
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
  public abstract DTM getDTM(int nodeHandle);
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
   * Given a W3C DOM node, try and return a DTM handle.
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
   * Note: calling this may be non-optimal.
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
   * @param node Non-null reference to a DOM node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
   * @return a valid DTM handle.
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
  public abstract int getDTMHandleFromNode(org.w3c.dom.Node node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
   * Creates a DTM representing an empty <code>DocumentFragment</code> object.
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
   * @return a non-null DTM reference.
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
  public abstract DTM createDocumentFragment();
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
   * Release a DTM either to a lru pool, or completely remove reference.
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
   * DTMs without system IDs are always hard deleted.
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
   * State: experimental.
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
   * @param dtm The DTM to be released.
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
   * @param shouldHardDelete True if the DTM should be removed no matter what.
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
   * @return true if the DTM was removed, false if it was put back in a lru pool.
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
  public abstract boolean release(DTM dtm, boolean shouldHardDelete);
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
   * Create a new <code>DTMIterator</code> based on an XPath
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
   * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
   * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
   * @param xpathCompiler ??? Somehow we need to pass in a subpart of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
   * expression.  I hate to do this with strings, since the larger expression
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
   * has already been parsed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
   * @param pos The position in the expression.
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
   * @return The newly created <code>DTMIterator</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
  public abstract DTMIterator createDTMIterator(Object xpathCompiler,
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
          int pos);
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
   * Create a new <code>DTMIterator</code> based on an XPath
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
   * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
   * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
   * @param xpathString Must be a valid string expressing a
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
   * <a href="http://www.w3.org/TR/xpath#NT-LocationPath>LocationPath</a> or
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
   * a <a href="http://www.w3.org/TR/xpath#NT-UnionExpr">UnionExpr</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
   * @param presolver An object that can resolve prefixes to namespace URLs.
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
   * @return The newly created <code>DTMIterator</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
  public abstract DTMIterator createDTMIterator(String xpathString,
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
          PrefixResolver presolver);
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
   * Create a new <code>DTMIterator</code> based only on a whatToShow
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
   * and a DTMFilter.  The traversal semantics are defined as the
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
   * descendant access.
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
   * <p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
   * Note that DTMIterators may not be an exact match to DOM
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
   * NodeIterators. They are initialized and used in much the same way
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
   * as a NodeIterator, but their response to document mutation is not
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
   * currently defined.
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
   * @param whatToShow This flag specifies which node types may appear in
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
   *   the logical view of the tree presented by the iterator. See the
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
   *   description of <code>NodeFilter</code> for the set of possible
7f561c08de6b Initial load
duke
parents:
diff changeset
   282
   *   <code>SHOW_</code> values.These flags can be combined using
7f561c08de6b Initial load
duke
parents:
diff changeset
   283
   *   <code>OR</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   284
   * @param filter The <code>NodeFilter</code> to be used with this
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
   *   <code>DTMFilter</code>, or <code>null</code> to indicate no filter.
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
   * @param entityReferenceExpansion The value of this flag determines
7f561c08de6b Initial load
duke
parents:
diff changeset
   287
   *   whether entity reference nodes are expanded.
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
   * @return The newly created <code>DTMIterator</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
  public abstract DTMIterator createDTMIterator(int whatToShow,
7f561c08de6b Initial load
duke
parents:
diff changeset
   292
          DTMFilter filter, boolean entityReferenceExpansion);
7f561c08de6b Initial load
duke
parents:
diff changeset
   293
7f561c08de6b Initial load
duke
parents:
diff changeset
   294
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   295
   * Create a new <code>DTMIterator</code> that holds exactly one node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   296
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   297
   * @param node The node handle that the DTMIterator will iterate to.
7f561c08de6b Initial load
duke
parents:
diff changeset
   298
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   299
   * @return The newly created <code>DTMIterator</code>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   300
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   301
  public abstract DTMIterator createDTMIterator(int node);
7f561c08de6b Initial load
duke
parents:
diff changeset
   302
7f561c08de6b Initial load
duke
parents:
diff changeset
   303
  /* Flag indicating whether an incremental transform is desired */
7f561c08de6b Initial load
duke
parents:
diff changeset
   304
  public boolean m_incremental = false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   305
7f561c08de6b Initial load
duke
parents:
diff changeset
   306
  /*
7f561c08de6b Initial load
duke
parents:
diff changeset
   307
   * Flag set by FEATURE_SOURCE_LOCATION.
7f561c08de6b Initial load
duke
parents:
diff changeset
   308
   * This feature specifies whether the transformation phase should
7f561c08de6b Initial load
duke
parents:
diff changeset
   309
   * keep track of line and column numbers for the input source
7f561c08de6b Initial load
duke
parents:
diff changeset
   310
   * document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   311
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   312
  public boolean m_source_location = false;
7f561c08de6b Initial load
duke
parents:
diff changeset
   313
7f561c08de6b Initial load
duke
parents:
diff changeset
   314
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   315
   * Get a flag indicating whether an incremental transform is desired
7f561c08de6b Initial load
duke
parents:
diff changeset
   316
   * @return incremental boolean.
7f561c08de6b Initial load
duke
parents:
diff changeset
   317
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   318
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   319
  public boolean getIncremental()
7f561c08de6b Initial load
duke
parents:
diff changeset
   320
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   321
    return m_incremental;
7f561c08de6b Initial load
duke
parents:
diff changeset
   322
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   323
7f561c08de6b Initial load
duke
parents:
diff changeset
   324
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   325
   * Set a flag indicating whether an incremental transform is desired
7f561c08de6b Initial load
duke
parents:
diff changeset
   326
   * This flag should have the same value as the FEATURE_INCREMENTAL feature
7f561c08de6b Initial load
duke
parents:
diff changeset
   327
   * which is set by the TransformerFactory.setAttribut() method before a
7f561c08de6b Initial load
duke
parents:
diff changeset
   328
   * DTMManager is created
7f561c08de6b Initial load
duke
parents:
diff changeset
   329
   * @param incremental boolean to use to set m_incremental.
7f561c08de6b Initial load
duke
parents:
diff changeset
   330
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   331
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   332
  public void setIncremental(boolean incremental)
7f561c08de6b Initial load
duke
parents:
diff changeset
   333
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   334
    m_incremental = incremental;
7f561c08de6b Initial load
duke
parents:
diff changeset
   335
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   336
7f561c08de6b Initial load
duke
parents:
diff changeset
   337
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   338
   * Get a flag indicating whether the transformation phase should
7f561c08de6b Initial load
duke
parents:
diff changeset
   339
   * keep track of line and column numbers for the input source
7f561c08de6b Initial load
duke
parents:
diff changeset
   340
   * document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   341
   * @return source location boolean
7f561c08de6b Initial load
duke
parents:
diff changeset
   342
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   343
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   344
  public boolean getSource_location()
7f561c08de6b Initial load
duke
parents:
diff changeset
   345
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   346
    return m_source_location;
7f561c08de6b Initial load
duke
parents:
diff changeset
   347
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   348
7f561c08de6b Initial load
duke
parents:
diff changeset
   349
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   350
   * Set a flag indicating whether the transformation phase should
7f561c08de6b Initial load
duke
parents:
diff changeset
   351
   * keep track of line and column numbers for the input source
7f561c08de6b Initial load
duke
parents:
diff changeset
   352
   * document.
7f561c08de6b Initial load
duke
parents:
diff changeset
   353
   * This flag should have the same value as the FEATURE_SOURCE_LOCATION feature
7f561c08de6b Initial load
duke
parents:
diff changeset
   354
   * which is set by the TransformerFactory.setAttribut() method before a
7f561c08de6b Initial load
duke
parents:
diff changeset
   355
   * DTMManager is created
7f561c08de6b Initial load
duke
parents:
diff changeset
   356
   * @param sourceLocation boolean to use to set m_source_location
7f561c08de6b Initial load
duke
parents:
diff changeset
   357
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   358
  public void setSource_location(boolean sourceLocation){
7f561c08de6b Initial load
duke
parents:
diff changeset
   359
    m_source_location = sourceLocation;
7f561c08de6b Initial load
duke
parents:
diff changeset
   360
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   361
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   362
    /**
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   363
     * Return the state of the services mechanism feature.
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   364
     */
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   365
    public boolean useServicesMechnism() {
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   366
        return _useServicesMechanism;
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   367
    }
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   368
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   369
    /**
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   370
     * Set the state of the services mechanism feature.
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   371
     */
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   372
    public void setServicesMechnism(boolean flag) {
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   373
        _useServicesMechanism = flag;
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   374
    }
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   375
7f561c08de6b Initial load
duke
parents:
diff changeset
   376
  // -------------------- private methods --------------------
7f561c08de6b Initial load
duke
parents:
diff changeset
   377
7f561c08de6b Initial load
duke
parents:
diff changeset
   378
   /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   379
   * Temp debug code - this will be removed after we test everything
7f561c08de6b Initial load
duke
parents:
diff changeset
   380
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   381
  private static boolean debug;
7f561c08de6b Initial load
duke
parents:
diff changeset
   382
7f561c08de6b Initial load
duke
parents:
diff changeset
   383
  static
7f561c08de6b Initial load
duke
parents:
diff changeset
   384
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   385
    try
7f561c08de6b Initial load
duke
parents:
diff changeset
   386
    {
16953
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12458
diff changeset
   387
      debug = SecuritySupport.getSystemProperty("dtm.debug") != null;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   388
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   389
    catch (SecurityException ex){}
7f561c08de6b Initial load
duke
parents:
diff changeset
   390
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   391
7f561c08de6b Initial load
duke
parents:
diff changeset
   392
  /** This value, set at compile time, controls how many bits of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   393
   * DTM node identifier numbers are used to identify a node within a
7f561c08de6b Initial load
duke
parents:
diff changeset
   394
   * document, and thus sets the maximum number of nodes per
7f561c08de6b Initial load
duke
parents:
diff changeset
   395
   * document. The remaining bits are used to identify the DTM
7f561c08de6b Initial load
duke
parents:
diff changeset
   396
   * document which contains this node.
7f561c08de6b Initial load
duke
parents:
diff changeset
   397
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   398
   * If you change IDENT_DTM_NODE_BITS, be sure to rebuild _ALL_ the
7f561c08de6b Initial load
duke
parents:
diff changeset
   399
   * files which use it... including the IDKey testcases.
7f561c08de6b Initial load
duke
parents:
diff changeset
   400
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   401
   * (FuncGenerateKey currently uses the node identifier directly and
7f561c08de6b Initial load
duke
parents:
diff changeset
   402
   * thus is affected when this changes. The IDKEY results will still be
7f561c08de6b Initial load
duke
parents:
diff changeset
   403
   * _correct_ (presuming no other breakage), but simple equality
7f561c08de6b Initial load
duke
parents:
diff changeset
   404
   * comparison against the previous "golden" files will probably
7f561c08de6b Initial load
duke
parents:
diff changeset
   405
   * complain.)
7f561c08de6b Initial load
duke
parents:
diff changeset
   406
   * */
7f561c08de6b Initial load
duke
parents:
diff changeset
   407
  public static final int IDENT_DTM_NODE_BITS = 16;
7f561c08de6b Initial load
duke
parents:
diff changeset
   408
7f561c08de6b Initial load
duke
parents:
diff changeset
   409
7f561c08de6b Initial load
duke
parents:
diff changeset
   410
  /** When this bitmask is ANDed with a DTM node handle number, the result
7f561c08de6b Initial load
duke
parents:
diff changeset
   411
   * is the low bits of the node's index number within that DTM. To obtain
7f561c08de6b Initial load
duke
parents:
diff changeset
   412
   * the high bits, add the DTM ID portion's offset as assigned in the DTM
7f561c08de6b Initial load
duke
parents:
diff changeset
   413
   * Manager.
7f561c08de6b Initial load
duke
parents:
diff changeset
   414
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   415
  public static final int IDENT_NODE_DEFAULT = (1<<IDENT_DTM_NODE_BITS)-1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   416
7f561c08de6b Initial load
duke
parents:
diff changeset
   417
7f561c08de6b Initial load
duke
parents:
diff changeset
   418
  /** When this bitmask is ANDed with a DTM node handle number, the result
7f561c08de6b Initial load
duke
parents:
diff changeset
   419
   * is the DTM's document identity number.
7f561c08de6b Initial load
duke
parents:
diff changeset
   420
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   421
  public static final int IDENT_DTM_DEFAULT = ~IDENT_NODE_DEFAULT;
7f561c08de6b Initial load
duke
parents:
diff changeset
   422
7f561c08de6b Initial load
duke
parents:
diff changeset
   423
  /** This is the maximum number of DTMs available.  The highest DTM is
7f561c08de6b Initial load
duke
parents:
diff changeset
   424
    * one less than this.
7f561c08de6b Initial load
duke
parents:
diff changeset
   425
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   426
  public static final int IDENT_MAX_DTMS = (IDENT_DTM_DEFAULT >>> IDENT_DTM_NODE_BITS) + 1;
7f561c08de6b Initial load
duke
parents:
diff changeset
   427
7f561c08de6b Initial load
duke
parents:
diff changeset
   428
7f561c08de6b Initial load
duke
parents:
diff changeset
   429
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   430
   * %TBD% Doc
7f561c08de6b Initial load
duke
parents:
diff changeset
   431
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   432
   * NEEDSDOC @param dtm
7f561c08de6b Initial load
duke
parents:
diff changeset
   433
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   434
   * NEEDSDOC ($objectName$) @return
7f561c08de6b Initial load
duke
parents:
diff changeset
   435
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   436
  public abstract int getDTMIdentity(DTM dtm);
7f561c08de6b Initial load
duke
parents:
diff changeset
   437
7f561c08de6b Initial load
duke
parents:
diff changeset
   438
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   439
   * %TBD% Doc
7f561c08de6b Initial load
duke
parents:
diff changeset
   440
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   441
   * NEEDSDOC ($objectName$) @return
7f561c08de6b Initial load
duke
parents:
diff changeset
   442
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   443
  public int getDTMIdentityMask()
7f561c08de6b Initial load
duke
parents:
diff changeset
   444
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   445
    return IDENT_DTM_DEFAULT;
7f561c08de6b Initial load
duke
parents:
diff changeset
   446
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   447
7f561c08de6b Initial load
duke
parents:
diff changeset
   448
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   449
   * %TBD% Doc
7f561c08de6b Initial load
duke
parents:
diff changeset
   450
   *
7f561c08de6b Initial load
duke
parents:
diff changeset
   451
   * NEEDSDOC ($objectName$) @return
7f561c08de6b Initial load
duke
parents:
diff changeset
   452
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   453
  public int getNodeIdentityMask()
7f561c08de6b Initial load
duke
parents:
diff changeset
   454
  {
7f561c08de6b Initial load
duke
parents:
diff changeset
   455
    return IDENT_NODE_DEFAULT;
7f561c08de6b Initial load
duke
parents:
diff changeset
   456
  }
7f561c08de6b Initial load
duke
parents:
diff changeset
   457
12458
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   458
    //
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   459
    // Classes
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   460
    //
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   461
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   462
    /**
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   463
     * A configuration error.
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   464
     * Originally in ObjectFactory. This is the only portion used in this package
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   465
     */
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   466
    static class ConfigurationError
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   467
        extends Error {
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   468
                static final long serialVersionUID = 5122054096615067992L;
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   469
        //
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   470
        // Data
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   471
        //
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   472
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   473
        /** Exception. */
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   474
        private Exception exception;
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   475
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   476
        //
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   477
        // Constructors
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   478
        //
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   479
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   480
        /**
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   481
         * Construct a new instance with the specified detail string and
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   482
         * exception.
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   483
         */
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   484
        ConfigurationError(String msg, Exception x) {
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   485
            super(msg);
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   486
            this.exception = x;
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   487
        } // <init>(String,Exception)
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   488
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   489
        //
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   490
        // Public methods
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   491
        //
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   492
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   493
        /** Returns the exception associated to this error. */
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   494
        Exception getException() {
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   495
            return exception;
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   496
        } // getException():Exception
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   497
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   498
    } // class ConfigurationError
d601e4bba306 7160380: Sync JDK8 with JAXP 1.4.5
joehw
parents: 12457
diff changeset
   499
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   500
}