src/java.xml/share/classes/com/sun/org/apache/xerces/internal/dom/DOMImplementationSourceImpl.java
changeset 47359 e1a6c0168741
parent 47216 71c04702a3d5
child 48409 5ab69533994b
equal deleted inserted replaced
47358:d07d5f7cab35 47359:e1a6c0168741
     1 /*
     1 /*
     2  * reserved comment block
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT REMOVE OR ALTER!
     3  * @LastModified: Oct 2017
     4  */
     4  */
     5 /*
     5 /*
     6  * Licensed to the Apache Software Foundation (ASF) under one or more
     6  * Licensed to the Apache Software Foundation (ASF) under one or more
     7  * contributor license agreements.  See the NOTICE file distributed with
     7  * contributor license agreements.  See the NOTICE file distributed with
     8  * this work for additional information regarding copyright ownership.
     8  * this work for additional information regarding copyright ownership.
    19  * limitations under the License.
    19  * limitations under the License.
    20  */
    20  */
    21 
    21 
    22 package com.sun.org.apache.xerces.internal.dom;
    22 package com.sun.org.apache.xerces.internal.dom;
    23 
    23 
       
    24 import java.util.ArrayList;
       
    25 import java.util.List;
    24 import java.util.StringTokenizer;
    26 import java.util.StringTokenizer;
    25 import java.util.Vector;
    27 import org.w3c.dom.DOMImplementation;
    26 import org.w3c.dom.DOMImplementationList;
    28 import org.w3c.dom.DOMImplementationList;
    27 import org.w3c.dom.DOMImplementationSource;
    29 import org.w3c.dom.DOMImplementationSource;
    28 import org.w3c.dom.DOMImplementation;
       
    29 import com.sun.org.apache.xerces.internal.dom.DOMImplementationListImpl;
       
    30 
    30 
    31 /**
    31 /**
    32  * Supply one the right implementation, based upon requested features. Each
    32  * Supply one the right implementation, based upon requested features. Each
    33  * implemented <code>DOMImplementationSource</code> object is listed in the
    33  * implemented <code>DOMImplementationSource</code> object is listed in the
    34  * binding-specific list of available sources so that its
    34  * binding-specific list of available sources so that its
    35  * <code>DOMImplementation</code> objects are made available.
    35  * <code>DOMImplementation</code> objects are made available.
    36  *
    36  *
    37  * <p>See also the <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMImplementationSource'>Document Object Model (DOM) Level 3 Core Specification</a>.
    37  * <p>See also the
       
    38  * <a href='http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#DOMImplementationSource'>
       
    39  * Document Object Model (DOM) Level 3 Core Specification</a>.
    38  *
    40  *
    39  * @xerces.internal
    41  * @xerces.internal
    40  *
    42  *
    41  */
    43  */
    42 public class DOMImplementationSourceImpl
    44 public class DOMImplementationSourceImpl
    79      *   features.
    81      *   features.
    80      */
    82      */
    81     public DOMImplementationList getDOMImplementationList(String features) {
    83     public DOMImplementationList getDOMImplementationList(String features) {
    82         // first check whether the CoreDOMImplementation would do
    84         // first check whether the CoreDOMImplementation would do
    83         DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
    85         DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
    84                 final Vector implementations = new Vector();
    86         final List<DOMImplementation> implementations = new ArrayList<>();
    85         if (testImpl(impl, features)) {
    87         if (testImpl(impl, features)) {
    86                         implementations.addElement(impl);
    88             implementations.add(impl);
    87         }
    89         }
    88         impl = DOMImplementationImpl.getDOMImplementation();
    90         impl = DOMImplementationImpl.getDOMImplementation();
    89         if (testImpl(impl, features)) {
    91         if (testImpl(impl, features)) {
    90                         implementations.addElement(impl);
    92             implementations.add(impl);
    91         }
    93         }
    92 
    94 
    93         return new DOMImplementationListImpl(implementations);
    95         return new DOMImplementationListImpl(implementations);
    94     }
    96     }
    95 
    97