@Override
public void writeTo(HashMap hashMap, Class<?> aClass, Type type, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> multivaluedMap, OutputStream outputStream) throws IOException, WebApplicationException {
try {
XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
XMLStreamWriter xmlWriter = outputFactory.createXMLStreamWriter(outputStream);
xmlWriter.writeStartElement("entity");
writeValue(hashMap, xmlWriter);
xmlWriter.writeEndElement();
xmlWriter.flush();
xmlWriter.close();
} catch (XMLStreamException e) {
throw new IOException(e);
}
}
XmlHashMapBodyWriter.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:Nasapi
作者:
评论列表
文章目录