jdk.internal.util.xml.SAXParser Java Examples

The following examples show how to use jdk.internal.util.xml.SAXParser. 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: TraceHandler.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
public static List<Type> createTypes() throws IOException {
    String[] xmls = { "trace.xml", "tracerelationdecls.xml", "traceevents.xml",
                      "tracetypes.xml"};
    TraceHandler t = new TraceHandler();
    try {
         SAXParser parser = new SAXParserImpl();
        for (String xml : xmls) {
            Logger.log(LogTag.JFR_SYSTEM, LogLevel.DEBUG, () -> "Parsing " + xml);
            parser.parse(createInputStream(xml), t);
        }
        t.defineValues();
        return new ArrayList<>(t.types.values());
    }  catch (SAXException  e) {
        throw new IOException(e);
    }
}
 
Example #2
Source File: MetadataHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public static List<Type> createTypes() throws IOException {
    SAXParser parser = new SAXParserImpl();
    MetadataHandler t = new MetadataHandler();
    try (InputStream is = new BufferedInputStream(SecuritySupport.getResourceAsStream("/jdk/jfr/internal/types/metadata.xml"))) {
        Logger.log(LogTag.JFR_SYSTEM, LogLevel.DEBUG, () -> "Parsing metadata.xml");
        try {
            parser.parse(is, t);
            return t.buildTypes();
        } catch (Exception e) {
            e.printStackTrace();
            throw new IOException(e);
        }
    }
}
 
Example #3
Source File: MetadataHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static List<Type> createTypes() throws IOException {
    SAXParser parser = new SAXParserImpl();
    MetadataHandler t = new MetadataHandler();
    try (InputStream is = new BufferedInputStream(SecuritySupport.getResourceAsStream("/jdk/jfr/internal/types/metadata.xml"))) {
        Logger.log(LogTag.JFR_SYSTEM, LogLevel.DEBUG, () -> "Parsing metadata.xml");
        try {
            parser.parse(is, t);
            return t.buildTypes();
        } catch (Exception e) {
            e.printStackTrace();
            throw new IOException(e);
        }
    }
}
 
Example #4
Source File: JFCParser.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private static void parseXML(String content, JFCParserHandler ch) throws SAXException, IOException {
    CharArrayReader r = new CharArrayReader(content.toCharArray());
    SAXParser parser = new SAXParserImpl();
    parser.parse(new InputSource(r), ch);
}
 
Example #5
Source File: JFCParser.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static void parseXML(String content, JFCParserHandler ch) throws SAXException, IOException {
    CharArrayReader r = new CharArrayReader(content.toCharArray());
    SAXParser parser = new SAXParserImpl();
    parser.parse(new InputSource(r), ch);
}
 
Example #6
Source File: JFCParser.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private static void parseXML(String content, JFCParserHandler ch) throws SAXException, IOException {
    CharArrayReader r = new CharArrayReader(content.toCharArray());
    SAXParser parser = new SAXParserImpl();
    parser.parse(new InputSource(r), ch);
}