Introduction

Storing data into xml files is easy, reading them too, but converting the data into java objects is usually messy. Of course there exist projects like the famous Apache Digester but these require quite some kilobytes which is fine for server applications but increases the volume for client applications. Furthermore there is too much work to configure these tools.

This tool shall provide three things:

  • A leightweight parser with no dependencies to other libraries
  • An easy, out-of-the-box solution for small projects like reading simple configuration data for an application
  • Provide the facilities to configure (yes, now you have to do it) more complex or inherited xml structures

The first goal is easy to achieve, although sometimes i am missing log4j, so this might later be the single exclusion from the rule.

The second goal is easy to describe, for simple cases like reading simple configuration data with a simple or well thought design only interfaces shall be needed to create. This can best be seen in the first example.

For the third goal the site lacks documentation at the moment, sorry.

Features

  • Declare only interfaces and receive the xml in form of java.lang.reflect.Proxies
  • Reads subelements into java.util.Collection elements, namely java.util.Set and java.util.List
  • Read subelements into java.util.Maps, using an annotated key attribute
  • Map tag to getter/setter-methods
  • Remove some method calls introduced in java 5 so this works with property based annotations with jdks pre tiger / java 5
  • >

Todos

  • Enable a mapping of element names to classes
  • Currently only interfaces and primitive types plus some classes of java.lang.* and java.util.* are accepted as return types. Enable arbitrary return types
  • Maybe support arrays as return type
  • Remove restriction to java.lang.Strings as key attribute for java.util.Maps
  • Enable more abstract java.util.Map
  • Fill this site with more content :-P

SourceForge.net Logo