org.schmant.support.xml.dom
Class DomParserSupport

java.lang.Object
  extended by org.schmant.support.xml.dom.DomParserSupport

public class DomParserSupport
extends Object

Utility class with static methods for DOM parsing XML documents.

Since:
0.7
Author:
Karl Gustafsson

Method Summary
static Document parseFile(DocumentBuilderFactory dbf, ReadableFile f)
          DOM parse the provided file and return the parsed Document.
static Document parseFile(DocumentBuilderFactory dbf, ReadableFile f, EntityResolver er, ErrorHandler eh)
          DOM parse the provided file and return the parsed Document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseFile

public static Document parseFile(DocumentBuilderFactory dbf,
                                 ReadableFile f,
                                 EntityResolver er,
                                 ErrorHandler eh)
                          throws IOException
DOM parse the provided file and return the parsed Document.

Parameters:
dbf - The DocumentBuilderFactory to use for creating a DocumentBuilder.
f - The file to parse.
er - An EntityResolver for resolving external entities. If this is null, no external entity resolver is used.
eh - An ErrorHandler for dealing with parse errors. This may be set to null.
Returns:
The XML Document.
Throws:
IOException - On I/O errors.
See Also:
parseFile(DocumentBuilderFactory, ReadableFile)

parseFile

public static Document parseFile(DocumentBuilderFactory dbf,
                                 ReadableFile f)
                          throws IOException
DOM parse the provided file and return the parsed Document.

Parameters:
dbf - The DocumentBuilderFactory to use for creating a DocumentBuilder.
f - The file to parse.
Returns:
The XML Document.
Throws:
IOException - On I/O errors.
See Also:
parseFile(DocumentBuilderFactory, ReadableFile, EntityResolver, ErrorHandler)