REST:从元素中提取属性

时间:2013-03-04 15:05:40

标签: java rest jersey

我有这个xml输出。

<Envelope pf:urn="urn:pf:envelope:1234">
  <ib:Item>1</ib:Item>
  <ib:Amount>15</ib:Amount>
  <ib:Location pf:url="http://mypage.com/1234/location" pf:urn="Envelope1234"/>
</Envelope>

我有这个POJO

import javax.xml.bing.annotation.*;

@XmlType(namespace="http://mypage.com/schemas/ib/2")
public class Envelope{
  @XmlElement(name="Item")
  private int item;

  @XmlElement(name="Amount")
  private int amount;
}

我需要从Location元素中获取url属性。 POJO将如何看待它?

0 个答案:

没有答案