XMap

The XMap application provides a transformation of a XML representation of a map to the corresponding java class. This application works for the classes:

  • java.util.HashMap
  • java.util.Set

The XML representation of a java.util.HashMap looks like this:

<item class-type="java.util.HashMap" key-type="java.lang.String" value-type="java.lang.String">
  <item name="k1">value1</item>
  <item name="k2">value2</item>
  <item name="k3">value3</item>
</item>
      

The structure for the other classes is similar. Only the class-type attribute has to be changed. The value-type is limited to:

  • java.lang.String
  • java.lang.Integer

Also mixed data types are valid:

<item class-type="java.util.HashMap" key-type="java.lang.String">
  <item name="k1" type="java.lang.String">value1</item>
  <item name="k2" type="java.lang.Integer">42</item>
</item>