|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.topologi.diffx.xml.XMLHelper
public final class XMLHelper
Utility class that provides common XML operations so that the calling class uses lighter code.
Most methdos in this implementation will forward the exceptions should occur, so they will have to be handled externally.
Method Summary | |
---|---|
static XMLReader |
makeXMLReader(ContentHandler handler)
Creates a non-validating, non-namespace-aware XMLReader using the specified
ContentHandler . |
static void |
parse(XMLReader xmlreader,
File file)
Parses the given File with the specified XMLReader . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static XMLReader makeXMLReader(ContentHandler handler) throws SAXException, ParserConfigurationException
XMLReader
using the specified
ContentHandler
.
If the given ContentHandler
is null
, the XMLReader
is
not initialised.
handler
- The content handler to use.
XMLReader
SAXException
- Should a SAX exception occur
ParserConfigurationException
- Should a parser config exception occurpublic static void parse(XMLReader xmlreader, File file) throws FileNotFoundException, SAXException, IOException
File
with the specified XMLReader
.
This method assumes the XML is in 'UTF-8', it will not sniff the XML to determine the encoding to use.
xmlreader
- The XML reader to use.file
- The file to parse
FileNotFoundException
- If the file does not exists
SAXException
- Should an SAX exception occur
IOException
- Should an I/O exception occur
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |