This code below works. However, it won't let me easily accommodate different types via generics. When I change the data members of Item2 to type Object, I get the following error:
@XmlAttribute/@XmlValue need to reference a
Java type that maps to text in XML.
Well that kinda makes sense. It seems like an unnecessary constraint, however, since I'm writing the code to convert strings to/from objects using casts.
Hmmm....
When I change Item2 to be the following, I get the same error:
I guess that makes sense too if I pass Item2<K,V> here:
Apparently the marshallar is does not know that K and V have been expanded to
String and String (respectively) and is seeing K and V as objects.
So how do I get around this problem?
Thanks,
Siegfried