Gridarta Editor
net.sf.gridarta.utils.xml.ParseUtils Class Reference

Utility class for parsing XML files. More...

+ Collaboration diagram for net.sf.gridarta.utils.xml.ParseUtils:

Static Public Member Functions

static Document readXmlStream (@NotNull final InputStream inputStream, @NotNull final String baseURI, @NotNull final String rootElement, @NotNull final String systemId, @NotNull final String resourceName, @Nullable final ErrorHandler errorHandler) throws IOException, ParsingException, SAXException, XIncludeException
 Reads an XML file. More...
 
static Document readXmlUrl (@NotNull final URL url, @NotNull final String rootElement, @NotNull final String systemId, @NotNull final String resourceName, @Nullable final ErrorHandler errorHandler) throws IOException, ParsingException, SAXException, URISyntaxException, XIncludeException
 Reads an XML file from an URL. More...
 

Private Member Functions

 ParseUtils ()
 Private constructor to prevent instantiation. More...
 

Detailed Description

Utility class for parsing XML files.

Author
Andreas Kirschbaum

Definition at line 43 of file ParseUtils.java.

Constructor & Destructor Documentation

◆ ParseUtils()

net.sf.gridarta.utils.xml.ParseUtils.ParseUtils ( )
private

Private constructor to prevent instantiation.

Definition at line 48 of file ParseUtils.java.

Member Function Documentation

◆ readXmlStream()

static Document net.sf.gridarta.utils.xml.ParseUtils.readXmlStream ( @NotNull final InputStream  inputStream,
@NotNull final String  baseURI,
@NotNull final String  rootElement,
@NotNull final String  systemId,
@NotNull final String  resourceName,
@Nullable final ErrorHandler  errorHandler 
) throws IOException, ParsingException, SAXException, XIncludeException
static

Reads an XML file.

Parameters
inputStreamthe XML file to read
baseURIthe base URI for resolving includes
rootElementthe tag name of the root element in the DOCTYPE declaration
systemIdthe system ID of the doctype declaration
resourceNamethe name of the resource that contains the DTD contents
errorHandlerthe error handler to use or
null
Returns
the document for the XML file
Exceptions
IOExceptionif the XML file cannot be read
ParsingExceptionif parsing the XML file fails
SAXExceptionthe parsing the XML file fails
XIncludeExceptionif parsing of the XML file fails

Definition at line 91 of file ParseUtils.java.

Referenced by net.sf.gridarta.utils.xml.ParseUtils.readXmlUrl().

+ Here is the caller graph for this function:

◆ readXmlUrl()

static Document net.sf.gridarta.utils.xml.ParseUtils.readXmlUrl ( @NotNull final URL  url,
@NotNull final String  rootElement,
@NotNull final String  systemId,
@NotNull final String  resourceName,
@Nullable final ErrorHandler  errorHandler 
) throws IOException, ParsingException, SAXException, URISyntaxException, XIncludeException
static

Reads an XML file from an URL.

Parameters
urlthe URL to read
rootElementthe tag name of the root element in the DOCTYPE declaration
systemIdthe system ID of the doctype declaration
resourceNamethe name of the resource that contains the DTD contents
errorHandlerthe error handler to use or
null
Returns
the document for the XML file
Exceptions
IOExceptionif the XML file cannot be read
ParsingExceptionif parsing the XML file fails
SAXExceptionthe parsing the XML file fails
URISyntaxExceptionif an include cannot be resolved
XIncludeExceptionif parsing of the XML file fails

Definition at line 68 of file ParseUtils.java.

References net.sf.gridarta.utils.xml.ParseUtils.readXmlStream().

Referenced by net.sf.gridarta.project.ProjectModel<?, ?, ?>.loadArchetypeTypeSet(), net.sf.gridarta.model.archetypetype.ArchetypeTypeSetParserTest.loadArchetypeTypeSet(), net.sf.gridarta.project.ProjectModel<?, ?, ?>.loadGameObjectMatchers(), net.sf.gridarta.project.ProjectModel<?, ?, ?>.loadSpecialTreasureLists(), and net.sf.gridarta.project.ProjectModel<?, ?, ?>.loadSpellFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: