No. It is still compiled in Java SE 7 and the runtime is still Java SE 7. It shouldn't have any Java 8 stuff.
I use a DocumentBuilder created by the DocumentBuilderFactor (which I have set to be an instance of com.sun.org.apache.xerces.internal.jaxp.DocumentBu ilderFactoryImpl).
It parses the URL with the InputStream provided by the openStream() method (
URL (Java Platform SE 7 )). That parses the info into org.w3c.dom objects.
/**
* Returns a Document from the give URL
* @param xml The url which contains the xml
* @return A document of the URL
* @throws ParserConfigurationException if the {@link DocumentBuilderFactory} implementation is not available or cannot be instantiated
* @throws IOException if an I/O exception occurs
* @throws SAXException if any parse errors occur
*/
public static Document loadXMLFromURL(URL xml) throws ParserConfigurationException, IOException, SAXException {
System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
DocumentBuilder builder = factory.newDocumentBuilder();
return builder.parse(xml.openStream());
}
The bottle neck appears to be continuous as it reads elements, not just an initial load thing.
I need to do more testing before I can figure out a proper cause.