Skip to content
This repository was archived by the owner on Jun 5, 2018. It is now read-only.

JelF/xmlparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XmlParser v0.999

XmlParser is a wrapper for org.xmlpull.v1.XmlPullParser, which allows to load structured data from XML.

Usage

XmlParser parser = new XmlParser(getResources().getXML(R.xml.something), factory)
XmlParser parser = new XmlParser(this, R.xml.something, factory)

factory here is an object, that implements TagAcceptorFactory interface. You can use HashMapFactory, which generates HashMapTags with public name, params, nested tags and value (see XmlParserTest for examples).

HashMapFactory is easy in use, but don't do any real work for you. The better idea is to use your common tag acceptors, generated by your own factory. There are different ways to make your own tag acceptors. First of all, you can simply implement TagAcceptor, but it's interface could be changed in few time. Better way is to extend abstract SimpleTagAcceptor or TagAcceptorWithDictionaryParams. You also can suggest another abstract classes which you found to be usefull
Custom factory usage example could be found in CustomFactoryTest

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published