Skip to content

zencd/free-form-xml-java-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

free-xml-java-parser

A very simple XML parser binding text into the given Java class structure.

Key features:

  • Parsing done by a Java model, no annotations needed
  • XML may come in different (free) forms but it gonna be parsed anyway

Let's there is a model:

public static class CarXml { public List<Wheel> wheel; public static class Wheel { public String name; } } 

Any of the following XMLs will be parsed as you might expect. The full form:

<root> <wheels> <wheel name='one'/> <wheel name='two'/> </wheels> </root> 

Without parent <wheels> it works too:

<root> <wheel name='one'/> <wheel name='two'/> </root> 

A special tag <item> automatically recognized as a wheel inside a collection:

<root> <wheels> <item name='one'/> </wheels> </root> 

Parser usage:

CarXml root = XmlTreeParser.parse(CarXml.class, xmlContent); 

About

A very lenient XML parser for Java binding text into the given model

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages