Java Code Examples for com.sun.xml.internal.ws.util.xml.XmlUtil#newXMLInputFactory()

The following examples show how to use com.sun.xml.internal.ws.util.xml.XmlUtil#newXMLInputFactory() . 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: ExternalMetadataReader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
static String documentRootNamespace(Source src, boolean disableXmlSecurity) throws XMLStreamException {
    XMLInputFactory factory;
    factory = XmlUtil.newXMLInputFactory(!disableXmlSecurity);
    XMLStreamReader streamReader = factory.createXMLStreamReader(src);
    XMLStreamReaderUtil.nextElementContent(streamReader);
    String namespaceURI = streamReader.getName().getNamespaceURI();
    XMLStreamReaderUtil.close(streamReader);
    return namespaceURI;
}
 
Example 2
Source File: MetroConfigLoader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
    MetroConfig result = null;
    try {
        JAXBContext jaxbContext = createJAXBContext();
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
        final JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(resourceUrl.openStream()), MetroConfig.class);
        result = configElement.getValue();
    } catch (Exception e) {
        LOGGER.warning(TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(resourceUrl.toString()), e);
    }
    return result;
}
 
Example 3
Source File: ExternalMetadataReader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
static String documentRootNamespace(Source src, boolean disableXmlSecurity) throws XMLStreamException {
    XMLInputFactory factory;
    factory = XmlUtil.newXMLInputFactory(!disableXmlSecurity);
    XMLStreamReader streamReader = factory.createXMLStreamReader(src);
    XMLStreamReaderUtil.nextElementContent(streamReader);
    String namespaceURI = streamReader.getName().getNamespaceURI();
    XMLStreamReaderUtil.close(streamReader);
    return namespaceURI;
}
 
Example 4
Source File: MetroConfigLoader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
    MetroConfig result = null;
    try {
        JAXBContext jaxbContext = createJAXBContext();
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
        final JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(resourceUrl.openStream()), MetroConfig.class);
        result = configElement.getValue();
    } catch (Exception e) {
        LOGGER.warning(TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(resourceUrl.toString()), e);
    }
    return result;
}
 
Example 5
Source File: ExternalMetadataReader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static String documentRootNamespace(Source src, boolean disableXmlSecurity) throws XMLStreamException {
    XMLInputFactory factory;
    factory = XmlUtil.newXMLInputFactory(!disableXmlSecurity);
    XMLStreamReader streamReader = factory.createXMLStreamReader(src);
    XMLStreamReaderUtil.nextElementContent(streamReader);
    String namespaceURI = streamReader.getName().getNamespaceURI();
    XMLStreamReaderUtil.close(streamReader);
    return namespaceURI;
}
 
Example 6
Source File: MetroConfigLoader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
    MetroConfig result = null;
    try {
        JAXBContext jaxbContext = createJAXBContext();
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
        final JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(resourceUrl.openStream()), MetroConfig.class);
        result = configElement.getValue();
    } catch (Exception e) {
        LOGGER.warning(TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(resourceUrl.toString()), e);
    }
    return result;
}
 
Example 7
Source File: ExternalMetadataReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
static String documentRootNamespace(Source src, boolean disableXmlSecurity) throws XMLStreamException {
    XMLInputFactory factory;
    factory = XmlUtil.newXMLInputFactory(!disableXmlSecurity);
    XMLStreamReader streamReader = factory.createXMLStreamReader(src);
    XMLStreamReaderUtil.nextElementContent(streamReader);
    String namespaceURI = streamReader.getName().getNamespaceURI();
    XMLStreamReaderUtil.close(streamReader);
    return namespaceURI;
}
 
Example 8
Source File: MetroConfigLoader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
    MetroConfig result = null;
    try {
        JAXBContext jaxbContext = createJAXBContext();
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
        final JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(resourceUrl.openStream()), MetroConfig.class);
        result = configElement.getValue();
    } catch (Exception e) {
        LOGGER.warning(TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(resourceUrl.toString()), e);
    }
    return result;
}
 
Example 9
Source File: ExternalMetadataReader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
static String documentRootNamespace(Source src, boolean disableXmlSecurity) throws XMLStreamException {
    XMLInputFactory factory;
    factory = XmlUtil.newXMLInputFactory(!disableXmlSecurity);
    XMLStreamReader streamReader = factory.createXMLStreamReader(src);
    XMLStreamReaderUtil.nextElementContent(streamReader);
    String namespaceURI = streamReader.getName().getNamespaceURI();
    XMLStreamReaderUtil.close(streamReader);
    return namespaceURI;
}
 
Example 10
Source File: MetroConfigLoader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
    try (InputStream is = getConfigInputStream(resourceUrl)) {
        JAXBContext jaxbContext = createJAXBContext();
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
        JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(is), MetroConfig.class);
        return configElement.getValue();
    } catch (Exception e) {
        String message = TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(
                resourceUrl != null ? resourceUrl.toString() : null);
        InternalError error = new InternalError(message);
        LOGGER.logException(error, e, Level.SEVERE);
        throw error;
    }
}
 
Example 11
Source File: ExternalMetadataReader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static String documentRootNamespace(Source src, boolean disableXmlSecurity) throws XMLStreamException {
    XMLInputFactory factory;
    factory = XmlUtil.newXMLInputFactory(!disableXmlSecurity);
    XMLStreamReader streamReader = factory.createXMLStreamReader(src);
    XMLStreamReaderUtil.nextElementContent(streamReader);
    String namespaceURI = streamReader.getName().getNamespaceURI();
    XMLStreamReaderUtil.close(streamReader);
    return namespaceURI;
}
 
Example 12
Source File: MetroConfigLoader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
    MetroConfig result = null;
    try {
        JAXBContext jaxbContext = createJAXBContext();
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
        final JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(resourceUrl.openStream()), MetroConfig.class);
        result = configElement.getValue();
    } catch (Exception e) {
        LOGGER.warning(TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(resourceUrl.toString()), e);
    }
    return result;
}
 
Example 13
Source File: ExternalMetadataReader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
static String documentRootNamespace(Source src, boolean disableXmlSecurity) throws XMLStreamException {
    XMLInputFactory factory;
    factory = XmlUtil.newXMLInputFactory(!disableXmlSecurity);
    XMLStreamReader streamReader = factory.createXMLStreamReader(src);
    XMLStreamReaderUtil.nextElementContent(streamReader);
    String namespaceURI = streamReader.getName().getNamespaceURI();
    XMLStreamReaderUtil.close(streamReader);
    return namespaceURI;
}
 
Example 14
Source File: MetroConfigLoader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
    MetroConfig result = null;
    try {
        JAXBContext jaxbContext = createJAXBContext();
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
        final JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(resourceUrl.openStream()), MetroConfig.class);
        result = configElement.getValue();
    } catch (Exception e) {
        LOGGER.warning(TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(resourceUrl.toString()), e);
    }
    return result;
}
 
Example 15
Source File: ExternalMetadataReader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
static String documentRootNamespace(Source src, boolean disableXmlSecurity) throws XMLStreamException {
    XMLInputFactory factory;
    factory = XmlUtil.newXMLInputFactory(!disableXmlSecurity);
    XMLStreamReader streamReader = factory.createXMLStreamReader(src);
    XMLStreamReaderUtil.nextElementContent(streamReader);
    String namespaceURI = streamReader.getName().getNamespaceURI();
    XMLStreamReaderUtil.close(streamReader);
    return namespaceURI;
}
 
Example 16
Source File: MetroConfigLoader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static MetroConfig loadMetroConfig(@NotNull URL resourceUrl) {
    MetroConfig result = null;
    try {
        JAXBContext jaxbContext = createJAXBContext();
        Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
        XMLInputFactory factory = XmlUtil.newXMLInputFactory(true);
        final JAXBElement<MetroConfig> configElement = unmarshaller.unmarshal(factory.createXMLStreamReader(resourceUrl.openStream()), MetroConfig.class);
        result = configElement.getValue();
    } catch (Exception e) {
        LOGGER.warning(TubelineassemblyMessages.MASM_0010_ERROR_READING_CFG_FILE_FROM_LOCATION(resourceUrl.toString()), e);
    }
    return result;
}