Class ParseUtils


  • public class ParseUtils
    extends java.lang.Object
    Utility class for parsing XML files.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull nu.xom.Document readXmlUrl​(@NotNull java.net.URL url, @NotNull java.lang.String rootElement, @NotNull java.lang.String systemId, @NotNull java.lang.String resourceName, @Nullable org.xml.sax.ErrorHandler errorHandler)
      Reads an XML file from an URL.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • readXmlUrl

        @NotNull
        public static @NotNull nu.xom.Document readXmlUrl​(@NotNull
                                                          @NotNull java.net.URL url,
                                                          @NotNull
                                                          @NotNull java.lang.String rootElement,
                                                          @NotNull
                                                          @NotNull java.lang.String systemId,
                                                          @NotNull
                                                          @NotNull java.lang.String resourceName,
                                                          @Nullable
                                                          @Nullable org.xml.sax.ErrorHandler errorHandler)
                                                   throws java.io.IOException,
                                                          nu.xom.ParsingException,
                                                          org.xml.sax.SAXException,
                                                          java.net.URISyntaxException,
                                                          nu.xom.xinclude.XIncludeException
        Reads an XML file from an URL.
        Parameters:
        url - the URL to read
        rootElement - the tag name of the root element in the DOCTYPE declaration
        systemId - the system ID of the doctype declaration
        resourceName - the name of the resource that contains the DTD contents
        errorHandler - the error handler to use or null
        Returns:
        the document for the XML file
        Throws:
        java.io.IOException - if the XML file cannot be read
        nu.xom.ParsingException - if parsing the XML file fails
        org.xml.sax.SAXException - the parsing the XML file fails
        java.net.URISyntaxException - if an include cannot be resolved
        nu.xom.xinclude.XIncludeException - if parsing of the XML file fails