【发布时间】:2013-02-15 21:31:54
【问题描述】:
我有一个 Customer 类和一个相关的 xml 文件。
File file = new File("D:\\TestingData\\customer.xml");
JAXBContext jaxbContext = JAXBContext.newInstance(Customer.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
Customer data = (Customer) jaxbUnmarshaller.unmarshal(file);
我需要将 customer.xml 文件放在外部位置。 (D:\TestingData\customer.xml)
我的问题是我可以将 xml 文件作为字符串的一部分提供给 unmarshall 方法吗??
【问题讨论】:
标签: jaxb