PriceModelResource.java 文件源码

java
阅读 16 收藏 0 点赞 0 评论 0

项目:development 作者:
/**
 * 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();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号