I am writing a RESTful web service client. The service end point requires XML in this format:
<top-level-element type=\"array\">
<element-key>
<element>foo</element>
<other-element>bar</element>
</element-key>
</top-level-element>
I have Java code as follows:
public class Parent {
@XmlElement(name="top-level-element")
@XmlJavaTypeAdapter(TopLevelElementKeyAdapter.class)
private HashMap<String, Integer> topLevelElement = new HashMap<String, Integer>();
}
public final class TopLevelElementKeyAdapter extends
XmlAdapter<MyElementMap, HashMap<String, Integer>>...
My code does everything I want, but I can't figure out how to get the 'type=\"array\" into my adapter. Thoughts?