JDK 11 java.xml.jmod - XML Module

JDK 11 java.xml.jmod is the JMOD file for JDK 11 XML (eXtensible Markup Language) module.

JDK 11 XML module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.xml.jmod.

JDK 11 XML module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.

JDK 11 XML module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.xml.

You can click and view the content of each source code file in the list below.

✍: FYIcenter

⏎ com/sun/org/apache/xpath/internal/jaxp/XPathNodesImpl.java

/*
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */

package com.sun.org.apache.xpath.internal.jaxp;

import java.util.Iterator;
import javax.xml.xpath.XPathException;
import javax.xml.xpath.XPathNodes;
import javax.xml.xpath.XPathEvaluationResult.XPathResultType;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

/**
 * This class implements XPathNodes that represents a set of nodes selected by
 * evaluating an expression.
 */
public class XPathNodesImpl implements XPathNodes {
    Class<Node> elementType;
    NodeList nodeList = null;

    public XPathNodesImpl(NodeList nodeList, Class<Node> elementType) {
        this.nodeList = nodeList;
        this.elementType = elementType;
    }

    @Override
    public Iterator<Node> iterator() {
        return new NodeSetIterator<>(elementType);
    }

    class NodeSetIterator<E> implements Iterator<E> {
        int currentIndex;
        Class<E> elementType;
        NodeSetIterator(Class<E> elementType) {
            this.elementType = elementType;
        }
        public boolean hasNext() {
            if (nodeList != null) {
                return currentIndex < nodeList.getLength();
            }

            return false;
        }

        public E next() {
            if (nodeList != null && nodeList.getLength() > 0) {
                return elementType.cast(nodeList.item(currentIndex++));
            }
            return null;
        }
    }

    @Override
    public int size() {
        if (nodeList != null) {
            return nodeList.getLength();
        }
        return 0;
    }

    @Override
    public Node get(int index) throws XPathException {
        if (index <0 || index >= size()) {
            throw new IndexOutOfBoundsException("Index " + index + " is out of bounds");
        }
        if (nodeList != null) {
            return nodeList.item(index);
        }
        return null;
    }
}

⏎ com/sun/org/apache/xpath/internal/jaxp/XPathNodesImpl.java

 

Or download all of them as a single archive file:

File name: java.xml-11.0.1-src.zip
File size: 4876106 bytes
Release date: 2018-11-04
Download 

 

⇒ JDK 11 java.xml.crypto.jmod - XML Crypto Module

⇐ JDK 11 java.transaction.xa.jmod - Transaction XA Module

⇑ Download and Use JDK 11

⇑⇑ FAQ for JDK (Java Development Kit)

2020-08-25, ≈689🔥, 0💬