org.w3c.dom.DOMImplementationList Java Examples

The following examples show how to use org.w3c.dom.DOMImplementationList. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DOMXSImplementationSourceImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    final Vector implementations = new Vector();

    // first check whether the CoreDOMImplementation would do
    DOMImplementationList list = super.getDOMImplementationList(features);
    //Add core DOMImplementations
    for (int i=0; i < list.getLength(); i++ ) {
        implementations.addElement(list.item(i));
    }

    DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }

    impl = XSImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }
    return new DOMImplementationListImpl(implementations);
}
 
Example #2
Source File: DOMXSImplementationSourceImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    final Vector implementations = new Vector();

    // first check whether the CoreDOMImplementation would do
    DOMImplementationList list = super.getDOMImplementationList(features);
    //Add core DOMImplementations
    for (int i=0; i < list.getLength(); i++ ) {
        implementations.addElement(list.item(i));
    }

    DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }

    impl = XSImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }
    return new DOMImplementationListImpl(implementations);
}
 
Example #3
Source File: DOMXSImplementationSourceImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    final Vector implementations = new Vector();

    // first check whether the CoreDOMImplementation would do
    DOMImplementationList list = super.getDOMImplementationList(features);
    //Add core DOMImplementations
    for (int i=0; i < list.getLength(); i++ ) {
        implementations.addElement(list.item(i));
    }

    DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }

    impl = XSImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }
    return new DOMImplementationListImpl(implementations);
}
 
Example #4
Source File: DOMXSImplementationSourceImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    final Vector implementations = new Vector();

    // first check whether the CoreDOMImplementation would do
    DOMImplementationList list = super.getDOMImplementationList(features);
    //Add core DOMImplementations
    for (int i=0; i < list.getLength(); i++ ) {
        implementations.addElement(list.item(i));
    }

    DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }

    impl = XSImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }
    return new DOMImplementationListImpl(implementations);
}
 
Example #5
Source File: DOMXSImplementationSourceImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    final Vector implementations = new Vector();

    // first check whether the CoreDOMImplementation would do
    DOMImplementationList list = super.getDOMImplementationList(features);
    //Add core DOMImplementations
    for (int i=0; i < list.getLength(); i++ ) {
        implementations.addElement(list.item(i));
    }

    DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }

    impl = XSImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }
    return new DOMImplementationListImpl(implementations);
}
 
Example #6
Source File: DOMXSImplementationSourceImpl.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    final List<DOMImplementation> implementations = new ArrayList<>();

    // first check whether the CoreDOMImplementation would do
    DOMImplementationList list = super.getDOMImplementationList(features);
    //Add core DOMImplementations
    for (int i=0; i < list.getLength(); i++ ) {
        implementations.add(list.item(i));
    }

    DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.add(impl);
    }

    impl = XSImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.add(impl);
    }
    return new DOMImplementationListImpl(implementations);
}
 
Example #7
Source File: DOMXSImplementationSourceImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    final Vector implementations = new Vector();

    // first check whether the CoreDOMImplementation would do
    DOMImplementationList list = super.getDOMImplementationList(features);
    //Add core DOMImplementations
    for (int i=0; i < list.getLength(); i++ ) {
        implementations.addElement(list.item(i));
    }

    DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }

    impl = XSImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }
    return new DOMImplementationListImpl(implementations);
}
 
Example #8
Source File: DOMXSImplementationSourceImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    final Vector implementations = new Vector();

    // first check whether the CoreDOMImplementation would do
    DOMImplementationList list = super.getDOMImplementationList(features);
    //Add core DOMImplementations
    for (int i=0; i < list.getLength(); i++ ) {
        implementations.addElement(list.item(i));
    }

    DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }

    impl = XSImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }
    return new DOMImplementationListImpl(implementations);
}
 
Example #9
Source File: DOMXSImplementationSourceImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    final Vector implementations = new Vector();

    // first check whether the CoreDOMImplementation would do
    DOMImplementationList list = super.getDOMImplementationList(features);
    //Add core DOMImplementations
    for (int i=0; i < list.getLength(); i++ ) {
        implementations.addElement(list.item(i));
    }

    DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }

    impl = XSImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }
    return new DOMImplementationListImpl(implementations);
}
 
Example #10
Source File: DOMXSImplementationSourceImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    final Vector implementations = new Vector();

    // first check whether the CoreDOMImplementation would do
    DOMImplementationList list = super.getDOMImplementationList(features);
    //Add core DOMImplementations
    for (int i=0; i < list.getLength(); i++ ) {
        implementations.addElement(list.item(i));
    }

    DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }

    impl = XSImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }
    return new DOMImplementationListImpl(implementations);
}
 
Example #11
Source File: DOMXSImplementationSourceImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    final Vector implementations = new Vector();

    // first check whether the CoreDOMImplementation would do
    DOMImplementationList list = super.getDOMImplementationList(features);
    //Add core DOMImplementations
    for (int i=0; i < list.getLength(); i++ ) {
        implementations.addElement(list.item(i));
    }

    DOMImplementation impl = PSVIDOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }

    impl = XSImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.addElement(impl);
    }
    return new DOMImplementationListImpl(implementations);
}
 
Example #12
Source File: DOMImplementationRegistry.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a list of implementations that support the
 * desired features.
 *
 * @param features
 *            A string that specifies which features are required. This is
 *            a space separated list in which each feature is specified by
 *            its name optionally followed by a space and a version number.
 *            This is something like: "XML 1.0 Traversal +Events 2.0"
 * @return A list of DOMImplementations that support the desired features.
 */
public DOMImplementationList getDOMImplementationList(final String features) {
    final Vector implementations = new Vector();
    int size = sources.size();
    for (int i = 0; i < size; i++) {
        DOMImplementationSource source =
            (DOMImplementationSource) sources.elementAt(i);
        DOMImplementationList impls =
            source.getDOMImplementationList(features);
        for (int j = 0; j < impls.getLength(); j++) {
            DOMImplementation impl = impls.item(j);
            implementations.addElement(impl);
        }
    }
    return new DOMImplementationList() {
            public DOMImplementation item(final int index) {
                if (index >= 0 && index < implementations.size()) {
                    try {
                        return (DOMImplementation)
                            implementations.elementAt(index);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        return null;
                    }
                }
                return null;
            }

            public int getLength() {
                return implementations.size();
            }
        };
}
 
Example #13
Source File: DOMImplementationSourceImpl.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    // first check whether the CoreDOMImplementation would do
    DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
            final Vector implementations = new Vector();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }
    impl = DOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }

    return new DOMImplementationListImpl(implementations);
}
 
Example #14
Source File: DOMImplementationSourceImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    // first check whether the CoreDOMImplementation would do
    DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
            final Vector implementations = new Vector();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }
    impl = DOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }

    return new DOMImplementationListImpl(implementations);
}
 
Example #15
Source File: DOMImplementationRegistry.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a list of implementations that support the
 * desired features.
 *
 * @param features
 *            A string that specifies which features are required. This is
 *            a space separated list in which each feature is specified by
 *            its name optionally followed by a space and a version number.
 *            This is something like: "XML 1.0 Traversal +Events 2.0"
 * @return A list of DOMImplementations that support the desired features.
 */
public DOMImplementationList getDOMImplementationList(final String features) {
    final Vector implementations = new Vector();
    int size = sources.size();
    for (int i = 0; i < size; i++) {
        DOMImplementationSource source =
            (DOMImplementationSource) sources.elementAt(i);
        DOMImplementationList impls =
            source.getDOMImplementationList(features);
        for (int j = 0; j < impls.getLength(); j++) {
            DOMImplementation impl = impls.item(j);
            implementations.addElement(impl);
        }
    }
    return new DOMImplementationList() {
            public DOMImplementation item(final int index) {
                if (index >= 0 && index < implementations.size()) {
                    try {
                        return (DOMImplementation)
                            implementations.elementAt(index);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        return null;
                    }
                }
                return null;
            }

            public int getLength() {
                return implementations.size();
            }
        };
}
 
Example #16
Source File: DOMImplementationSourceImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    // first check whether the CoreDOMImplementation would do
    DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
            final Vector implementations = new Vector();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }
    impl = DOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }

    return new DOMImplementationListImpl(implementations);
}
 
Example #17
Source File: DOMImplementationRegistry.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a list of implementations that support the
 * desired features.
 *
 * @param features
 *            A string that specifies which features are required. This is
 *            a space separated list in which each feature is specified by
 *            its name optionally followed by a space and a version number.
 *            This is something like: "XML 1.0 Traversal +Events 2.0"
 * @return A list of DOMImplementations that support the desired features.
 */
public DOMImplementationList getDOMImplementationList(final String features) {
    final Vector implementations = new Vector();
    int size = sources.size();
    for (int i = 0; i < size; i++) {
        DOMImplementationSource source =
            (DOMImplementationSource) sources.elementAt(i);
        DOMImplementationList impls =
            source.getDOMImplementationList(features);
        for (int j = 0; j < impls.getLength(); j++) {
            DOMImplementation impl = impls.item(j);
            implementations.addElement(impl);
        }
    }
    return new DOMImplementationList() {
            public DOMImplementation item(final int index) {
                if (index >= 0 && index < implementations.size()) {
                    try {
                        return (DOMImplementation)
                            implementations.elementAt(index);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        return null;
                    }
                }
                return null;
            }

            public int getLength() {
                return implementations.size();
            }
        };
}
 
Example #18
Source File: DOMImplementationRegistry.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a list of implementations that support the
 * desired features.
 *
 * @param features
 *            A string that specifies which features are required. This is
 *            a space separated list in which each feature is specified by
 *            its name optionally followed by a space and a version number.
 *            This is something like: "XML 1.0 Traversal +Events 2.0"
 * @return A list of DOMImplementations that support the desired features.
 */
public DOMImplementationList getDOMImplementationList(final String features) {
    final Vector implementations = new Vector();
    int size = sources.size();
    for (int i = 0; i < size; i++) {
        DOMImplementationSource source =
            (DOMImplementationSource) sources.elementAt(i);
        DOMImplementationList impls =
            source.getDOMImplementationList(features);
        for (int j = 0; j < impls.getLength(); j++) {
            DOMImplementation impl = impls.item(j);
            implementations.addElement(impl);
        }
    }
    return new DOMImplementationList() {
            public DOMImplementation item(final int index) {
                if (index >= 0 && index < implementations.size()) {
                    try {
                        return (DOMImplementation)
                            implementations.elementAt(index);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        return null;
                    }
                }
                return null;
            }

            public int getLength() {
                return implementations.size();
            }
        };
}
 
Example #19
Source File: DOMImplementationSourceImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    // first check whether the CoreDOMImplementation would do
    DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
            final Vector implementations = new Vector();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }
    impl = DOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }

    return new DOMImplementationListImpl(implementations);
}
 
Example #20
Source File: DOMImplementationRegistry.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a list of implementations that support the
 * desired features.
 *
 * @param features
 *            A string that specifies which features are required. This is
 *            a space separated list in which each feature is specified by
 *            its name optionally followed by a space and a version number.
 *            This is something like: "XML 1.0 Traversal +Events 2.0"
 * @return A list of DOMImplementations that support the desired features.
 */
public DOMImplementationList getDOMImplementationList(final String features) {
    final Vector implementations = new Vector();
    int size = sources.size();
    for (int i = 0; i < size; i++) {
        DOMImplementationSource source =
            (DOMImplementationSource) sources.elementAt(i);
        DOMImplementationList impls =
            source.getDOMImplementationList(features);
        for (int j = 0; j < impls.getLength(); j++) {
            DOMImplementation impl = impls.item(j);
            implementations.addElement(impl);
        }
    }
    return new DOMImplementationList() {
            public DOMImplementation item(final int index) {
                if (index >= 0 && index < implementations.size()) {
                    try {
                        return (DOMImplementation)
                            implementations.elementAt(index);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        return null;
                    }
                }
                return null;
            }

            public int getLength() {
                return implementations.size();
            }
        };
}
 
Example #21
Source File: DOMImplementationRegistry.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
/**
 * Return a list of implementations that support the
 * desired features.
 *
 * @param features
 *            A string that specifies which features are required. This is
 *            a space separated list in which each feature is specified by
 *            its name optionally followed by a space and a version number.
 *            This is something like: "XML 1.0 Traversal +Events 2.0"
 * @return A list of DOMImplementations that support the desired features.
 */
public DOMImplementationList getDOMImplementationList(final String features) {
    final Vector implementations = new Vector();
    int size = sources.size();
    for (int i = 0; i < size; i++) {
        DOMImplementationSource source =
            (DOMImplementationSource) sources.elementAt(i);
        DOMImplementationList impls =
            source.getDOMImplementationList(features);
        for (int j = 0; j < impls.getLength(); j++) {
            DOMImplementation impl = impls.item(j);
            implementations.addElement(impl);
        }
    }
    return new DOMImplementationList() {
            public DOMImplementation item(final int index) {
                if (index >= 0 && index < implementations.size()) {
                    try {
                        return (DOMImplementation)
                            implementations.elementAt(index);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        return null;
                    }
                }
                return null;
            }

            public int getLength() {
                return implementations.size();
            }
        };
}
 
Example #22
Source File: DOMImplementationSourceImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    // first check whether the CoreDOMImplementation would do
    DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
            final Vector implementations = new Vector();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }
    impl = DOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }

    return new DOMImplementationListImpl(implementations);
}
 
Example #23
Source File: DOMImplementationSourceImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    // first check whether the CoreDOMImplementation would do
    DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
            final Vector implementations = new Vector();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }
    impl = DOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }

    return new DOMImplementationListImpl(implementations);
}
 
Example #24
Source File: DOMImplementationSourceImpl.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    // first check whether the CoreDOMImplementation would do
    DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
    final List<DOMImplementation> implementations = new ArrayList<>();
    if (testImpl(impl, features)) {
        implementations.add(impl);
    }
    impl = DOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
        implementations.add(impl);
    }

    return new DOMImplementationListImpl(implementations);
}
 
Example #25
Source File: DOMImplementationRegistry.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
/**
 * Return a list of implementations that support the
 * desired features.
 *
 * @param features
 *            A string that specifies which features are required. This is
 *            a space separated list in which each feature is specified by
 *            its name optionally followed by a space and a version number.
 *            This is something like: "XML 1.0 Traversal +Events 2.0"
 * @return A list of DOMImplementations that support the desired features.
 */
public DOMImplementationList getDOMImplementationList(final String features) {
    final List<DOMImplementation> implementations = new ArrayList<>();
    int size = sources.size();
    for (int i = 0; i < size; i++) {
        DOMImplementationSource source = sources.get(i);
        DOMImplementationList impls =
            source.getDOMImplementationList(features);
        for (int j = 0; j < impls.getLength(); j++) {
            DOMImplementation impl = impls.item(j);
            implementations.add(impl);
        }
    }
    return new DOMImplementationList() {
            public DOMImplementation item(final int index) {
                if (index >= 0 && index < implementations.size()) {
                    try {
                        return implementations.get(index);
                    } catch (IndexOutOfBoundsException e) {
                        return null;
                    }
                }
                return null;
            }

            public int getLength() {
                return implementations.size();
            }
        };
}
 
Example #26
Source File: DOMImplementationRegistry.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Return a list of implementations that support the
 * desired features.
 *
 * @param features
 *            A string that specifies which features are required. This is
 *            a space separated list in which each feature is specified by
 *            its name optionally followed by a space and a version number.
 *            This is something like: "XML 1.0 Traversal +Events 2.0"
 * @return A list of DOMImplementations that support the desired features.
 */
public DOMImplementationList getDOMImplementationList(final String features) {
    final Vector implementations = new Vector();
    int size = sources.size();
    for (int i = 0; i < size; i++) {
        DOMImplementationSource source =
            (DOMImplementationSource) sources.elementAt(i);
        DOMImplementationList impls =
            source.getDOMImplementationList(features);
        for (int j = 0; j < impls.getLength(); j++) {
            DOMImplementation impl = impls.item(j);
            implementations.addElement(impl);
        }
    }
    return new DOMImplementationList() {
            public DOMImplementation item(final int index) {
                if (index >= 0 && index < implementations.size()) {
                    try {
                        return (DOMImplementation)
                            implementations.elementAt(index);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        return null;
                    }
                }
                return null;
            }

            public int getLength() {
                return implementations.size();
            }
        };
}
 
Example #27
Source File: DOMImplementationSourceImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    // first check whether the CoreDOMImplementation would do
    DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
            final Vector implementations = new Vector();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }
    impl = DOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }

    return new DOMImplementationListImpl(implementations);
}
 
Example #28
Source File: DOMImplementationRegistry.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a list of implementations that support the
 * desired features.
 *
 * @param features
 *            A string that specifies which features are required. This is
 *            a space separated list in which each feature is specified by
 *            its name optionally followed by a space and a version number.
 *            This is something like: "XML 1.0 Traversal +Events 2.0"
 * @return A list of DOMImplementations that support the desired features.
 */
public DOMImplementationList getDOMImplementationList(final String features) {
    final Vector implementations = new Vector();
    int size = sources.size();
    for (int i = 0; i < size; i++) {
        DOMImplementationSource source =
            (DOMImplementationSource) sources.elementAt(i);
        DOMImplementationList impls =
            source.getDOMImplementationList(features);
        for (int j = 0; j < impls.getLength(); j++) {
            DOMImplementation impl = impls.item(j);
            implementations.addElement(impl);
        }
    }
    return new DOMImplementationList() {
            public DOMImplementation item(final int index) {
                if (index >= 0 && index < implementations.size()) {
                    try {
                        return (DOMImplementation)
                            implementations.elementAt(index);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        return null;
                    }
                }
                return null;
            }

            public int getLength() {
                return implementations.size();
            }
        };
}
 
Example #29
Source File: DOMImplementationRegistry.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Return a list of implementations that support the
 * desired features.
 *
 * @param features
 *            A string that specifies which features are required. This is
 *            a space separated list in which each feature is specified by
 *            its name optionally followed by a space and a version number.
 *            This is something like: "XML 1.0 Traversal +Events 2.0"
 * @return A list of DOMImplementations that support the desired features.
 */
public DOMImplementationList getDOMImplementationList(final String features) {
    final Vector implementations = new Vector();
    int size = sources.size();
    for (int i = 0; i < size; i++) {
        DOMImplementationSource source =
            (DOMImplementationSource) sources.elementAt(i);
        DOMImplementationList impls =
            source.getDOMImplementationList(features);
        for (int j = 0; j < impls.getLength(); j++) {
            DOMImplementation impl = impls.item(j);
            implementations.addElement(impl);
        }
    }
    return new DOMImplementationList() {
            public DOMImplementation item(final int index) {
                if (index >= 0 && index < implementations.size()) {
                    try {
                        return (DOMImplementation)
                            implementations.elementAt(index);
                    } catch (ArrayIndexOutOfBoundsException e) {
                        return null;
                    }
                }
                return null;
            }

            public int getLength() {
                return implementations.size();
            }
        };
}
 
Example #30
Source File: DOMImplementationSourceImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * A method to request a list of DOM implementations that support the
 * specified features and versions, as specified in .
 * @param features A string that specifies which features and versions
 *   are required. This is a space separated list in which each feature
 *   is specified by its name optionally followed by a space and a
 *   version number. This is something like: "XML 3.0 Traversal +Events
 *   2.0"
 * @return A list of DOM implementations that support the desired
 *   features.
 */
public DOMImplementationList getDOMImplementationList(String features) {
    // first check whether the CoreDOMImplementation would do
    DOMImplementation impl = CoreDOMImplementationImpl.getDOMImplementation();
            final Vector implementations = new Vector();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }
    impl = DOMImplementationImpl.getDOMImplementation();
    if (testImpl(impl, features)) {
                    implementations.addElement(impl);
    }

    return new DOMImplementationListImpl(implementations);
}