Examples of BVProductStatistic


Examples of org.nijhazer.bazaarvoice.core.model.statistic.BVProductStatistic

    public BVResponse update(JSONObject json, BVResponse elementToUpdate) {
        List<BVElement> productStatisticsList = new ArrayList<BVElement>();
        JSONArray results = this.getResults(json);
        int numberOfEntries = results.length();
        for (int i = 0; i < numberOfEntries; i++) {
            BVProductStatistic responseProductStatistics = new BVProductStatistic();
            JSONObject productStatistics = null;
            try {
                productStatistics = results.getJSONObject(i).getJSONObject(BVConstants.JSON_PRODUCT_STATISTICS.toString());
            } catch (JSONException e) {
                logJSONException(String.format(ITERATIVE_EXCEPTION_PATTERN, BVConstants.JSON_PRODUCT_STATISTICS, i), e);
            }
            try {
                responseProductStatistics.setProductId(productStatistics.getString(BVConstants.JSON_PRODUCT_ID.toString()));
            } catch (JSONException e) {
                logJSONException(String.format(ITERATIVE_EXCEPTION_PATTERN, BVConstants.JSON_PRODUCT_ID, i), e);
            }
            try {
                responseProductStatistics.setReviewStatistics(
                    processReviewStatistics(
                        productStatistics.getJSONObject(
                            BVConstants.JSON_REVIEW_STATISTICS.toString())));
            } catch (JSONException e) {
                logJSONException(String.format(ITERATIVE_EXCEPTION_PATTERN, BVConstants.JSON_REVIEW_STATISTICS, i), e);
            } catch (BVJSONProcessingException e) {
                logJSONException(String.format(ITERATIVE_EXCEPTION_PATTERN, e.getValueInError(), i), e.getOriginalJSONException());
            }
            try {
                responseProductStatistics.setNativeReviewStatistics(
                    processReviewStatistics(
                        productStatistics.getJSONObject(
                            BVConstants.JSON_NATIVE_REVIEW_STATISTICS.toString())));
            } catch (JSONException e) {
                logJSONException(String.format(ITERATIVE_EXCEPTION_PATTERN, BVConstants.JSON_NATIVE_REVIEW_STATISTICS, i), e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.