commons beanutils alternative

Steven picture Steven · Oct 15, 2010 · Viewed 7.9k times · Source

I am looking for a commons beanutils alternative. The reason is that beanutils relies on commons-logging which is conflicting with existing libraries I am using.

I would like a small self-contained alternative which will cause no/minimal conflicts.

The main functionality I am after is nested property retrieval.

Thanks in advance, Steven

Answer

StaxMan picture StaxMan · Feb 2, 2011

While property handling is not the main focus of Jackson, it can be used for that, as per this article.

The basic idea is that you can not only read/write JSON to/from POJOs, but also do compatible conversions: including that of "serializing" a POJO as a Java Map. Since you can go back and forth between representations you basically get a bean introspector for free.

Jackson has no external dependencies, but you need both core (streaming api, impls) and mapper jars (data binding).