public class SimpleXMLReader extends DefaultHandler
Modifier and Type | Field and Description |
---|---|
protected int |
indent |
protected Object[] |
stack |
protected String |
value |
Constructor and Description |
---|
SimpleXMLReader() |
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] buf,
int offset,
int len) |
void |
endDocument() |
void |
endElement(String namespaceURI,
String sName,
String qName) |
HashMap<String,Object> |
parse(String xml) |
protected void |
processProperty(String eName,
HashMap value,
HashMap hm) |
protected void |
processProperty(String eName,
String value,
HashMap hm) |
void |
startDocument() |
void |
startElement(String namespaceURI,
String sName,
String qName,
Attributes attrs) |
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
protected String value
protected int indent
protected Object[] stack
public HashMap<String,Object> parse(String xml) throws Exception
xml
- text to parse.Exception
public void startElement(String namespaceURI, String sName, String qName, Attributes attrs) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
public void endElement(String namespaceURI, String sName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
public void characters(char[] buf, int offset, int len) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
SAXException
Copyright © 1999–2019 ViaOA. All rights reserved.