public class XML2Map
extends org.xml.sax.helpers.DefaultHandler
Modifier and Type | Field and Description |
---|---|
static int |
XML_ARRAY |
static int |
XML_DEFAULT |
static int |
XML_NULL |
Constructor and Description |
---|
XML2Map(java.lang.String parser) |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length) |
static boolean |
containsKey(java.util.Map ph,
java.lang.String keyPath)
returns true if the keyPath exists or false otherwise
|
static int |
count(java.util.Map ph,
java.lang.String keyPath)
returns the number of children referenced by the keyPath or -1
|
void |
endDocument() |
void |
endElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName) |
static java.lang.Object |
get(java.util.Map ph,
java.lang.String keyPath)
returns the object referenced by the keyPath or null
|
java.util.Map |
getMap(java.io.InputStream in) |
java.util.Map |
getMap(java.io.Reader in) |
java.util.Map |
getMap(java.lang.String url) |
static void |
main(java.lang.String[] args) |
void |
startDocument() |
void |
startElement(java.lang.String uri,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes atts) |
public static final int XML_DEFAULT
public static final int XML_ARRAY
public static final int XML_NULL
public XML2Map(java.lang.String parser) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public java.util.Map getMap(java.io.Reader in) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public java.util.Map getMap(java.io.InputStream in) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public java.util.Map getMap(java.lang.String url) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public static boolean containsKey(java.util.Map ph, java.lang.String keyPath)
public static int count(java.util.Map ph, java.lang.String keyPath)
public static java.lang.Object get(java.util.Map ph, java.lang.String keyPath)
public void startDocument()
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
public void endDocument()
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
public void startElement(java.lang.String uri, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes atts)
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
public void endElement(java.lang.String uri, java.lang.String name, java.lang.String qName)
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
public void characters(char[] ch, int start, int length)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception