- Notifications
You must be signed in to change notification settings - Fork0
zencd/free-form-xml-java-parser
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A very simple XML parser loosely binding text into the given Java class structure.
Written byzencd. Java7+.
- Parsing done by a Java model, no annoytations needed
- XML may come in different (free) forms but it gonna be parsed anyway
public static class CarXml { public String color; public List<Wheel> wheel; public static class Wheel { public String name; }}Setting a Java property could be done via an XML attribute, but also via a dedicated tag:
<root color='red'/><root> <color>red</color></root>The full form:
<root> <wheels> <wheel name='one'/> <wheel name='two'/> </wheels></root>Without the parent<wheels> it works too:
<root> <wheel name='one'/> <wheel name='two'/></root>A special tag<item> automatically recognized as a<wheel> being inside a collection:
<root> <wheels> <item name='one'/> </wheels></root>You may also mix all the approaches.
CarXml root = FreeFormXmlParser.parse(CarXml.class, xmlContent);Also refer to tests likeFreeFormXmlParserTest.
SeePropertyBinder and its derivationDefaultPropertyBinder.
Bind properties likesome-propto Java, and tag names also- Be able to bind 'NaMe' to 'NamE' (any forms)
About
A very lenient XML parser for Java binding text into the given model
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.