Wednesday 14 January 2015

Conversion Box

The Conversion Box component works with the idea of converting data from one structure to another. It can be used to carry out conversions between Maps, JSONs, XMLs and Java Objects. It also converts Lists of Maps embedded within them to their corresponding equivalent. Also, the hierarchy within the data structure is maintained.

Additionally, the key can also be substituted with another value in the final conversion if a Map containing the value with which it can be substituted with, is provided. While the conversion is in progress, the component will refer to this Map and substitute all the keys with the value mentioned in the Map.

It offers the following conversions:

1. Map to JSON.
2. Map to XML.
3. Map to Java Object.
4. JSON to Map.
5. JSON to XML.
6. JSON to Java Object.
7. XML to Map.
8. XML to JSON.
9. XML to Java Object.
10. Java Object to Map.
11. Java Object to JSON.
12. Java Object to XML.


Let me know your feedback. You can download the JAR, Documentation, Release Notes and Examples from the following locations:

Conversion Box v1.1

Conversion Box v1.0

Known Issues and Limitations:

1. All Lists embedded within a data structure need to be Lists of Maps and not just Lists.
2. Special characters are not escaped or handled.
3. In case of conversions where Java Objects are involved, Maps and Lists of Maps within a Java Object are supported. However, Java Objects within Maps or Lists are not supported.
4. Every key in the data structure (nested or not) needs to be unique.

1 comment:

  1. Underscore-java library can convert xml to json and vice versa.

    ReplyDelete