/**
* Get the price model data for the given context and locales
*
* @return the price model data as an XML encoded list of strings
*/
@GET
@Produces(MediaType.TEXT_PLAIN)
public Response getPriceModel() {
FileBilling fb = new FileBilling();
splitParametersToList(contextKeys);
splitParametersToList(contextValues);
List<String> priceModelContent = fb.getPriceModel(contextKeys,
contextValues, locales);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
try (XMLEncoder xmlEncoder = new XMLEncoder(bos)) {
xmlEncoder.writeObject(priceModelContent);
}
String serializedList = "";
try {
serializedList = bos.toString(StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
}
return Response.ok(serializedList).build();
}
PriceModelResource.java 文件源码
java
阅读 16
收藏 0
点赞 0
评论 0
项目:development
作者:
评论列表
文章目录