Given the following xml code:
<root>
  <vector>{1, 2, 3, 4, 5}</vector>
</root>
Is it possible to unmarshal the element <vector> into a 5 element array, such that:
array = {1, 2, 3, 4, 5}
In my attempt to do this I have written some code, but it fails to correctly split the <vector> into an array where each number is a separate element:
@XmlType(propOrder = {"vector"})
@XmlRootElement(name = "root")
public class Data
{
  // class data
  private int[] vector;
  @XmlElement(name = "vector")
  public void setVector(int[] vector)
  {
    this.vector = vector;
  }
  public int[] getVector()
  {
    return vector;
  }
}
				
                        
You need a XmlAdapter, something like this:
Then annotate your element with @XmlJavaTypeAdapter: