|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jagatoo.util.xml.SimpleXMLParser
public class SimpleXMLParser
This class invokes simple XML parsing.
This not only provides full XML path information at every state of the parsing process, but also gives you the opportunity to fork the entity handling and delegate it to another handler. The fork is automatically undone when the root of the fork is detected.
An example:
Implement SimpleXMLHandlerFork and call the instance f.
Implement SimpleXMLHandler and call the instance h.
Invoke the parser and pass it h.
In the h implementation you would then detect a certain element start and invoke the handler's fork() method and pass f.
All the elements inside of this element are now handled by f which doesn't need to know anything about the parent elements
and even gets an XMLPath, that roots to the forking element.
Constructor Summary | |
---|---|
SimpleXMLParser()
|
Method Summary | |
---|---|
static void |
parseXML(java.io.File file,
java.nio.charset.Charset charset,
SimpleXMLHandler handler)
Parses the given file. |
static void |
parseXML(java.io.File file,
SimpleXMLHandler handler)
Parses the given file. |
static void |
parseXML(java.io.File file,
java.lang.String charset,
SimpleXMLHandler handler)
Parses the given file. |
static void |
parseXML(java.io.InputStream in,
java.nio.charset.Charset charset,
SimpleXMLHandler handler)
Parses the given file. |
static void |
parseXML(java.io.InputStream in,
SimpleXMLHandler handler)
Parses the given file. |
static void |
parseXML(java.io.InputStream in,
java.lang.String charset,
SimpleXMLHandler handler)
Parses the given file. |
static void |
parseXML(java.lang.String filename,
java.nio.charset.Charset charset,
SimpleXMLHandler handler)
Parses the given file. |
static void |
parseXML(java.lang.String filename,
SimpleXMLHandler handler)
Parses the given file. |
static void |
parseXML(java.lang.String filename,
java.lang.String charset,
SimpleXMLHandler handler)
Parses the given file. |
static void |
parseXML(java.net.URL url,
java.nio.charset.Charset charset,
SimpleXMLHandler handler)
Parses the given file. |
static void |
parseXML(java.net.URL url,
SimpleXMLHandler handler)
Parses the given file. |
static void |
parseXML(java.net.URL url,
java.lang.String charset,
SimpleXMLHandler handler)
Parses the given file. |
protected static void |
parseXMLImpl(java.io.InputStream in,
java.lang.String codepage,
java.nio.charset.Charset charset,
SimpleXMLHandler handler)
Parses the given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleXMLParser()
Method Detail |
---|
protected static void parseXMLImpl(java.io.InputStream in, java.lang.String codepage, java.nio.charset.Charset charset, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
in
- codepage
- charset
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.io.InputStream in, java.lang.String charset, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
in
- charset
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.io.InputStream in, java.nio.charset.Charset charset, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
in
- charset
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.io.InputStream in, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
in
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.net.URL url, java.lang.String charset, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
url
- charset
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.net.URL url, java.nio.charset.Charset charset, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
url
- charset
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.net.URL url, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
url
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.io.File file, java.lang.String charset, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
file
- charset
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.io.File file, java.nio.charset.Charset charset, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
file
- charset
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.io.File file, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
file
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.lang.String filename, java.lang.String charset, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
filename
- charset
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.lang.String filename, java.nio.charset.Charset charset, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
filename
- charset
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static final void parseXML(java.lang.String filename, SimpleXMLHandler handler) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
filename
- handler
-
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |