Package net.sf.json

Examples of net.sf.json.JSONArray.element()


        final PrintWriter writer = response.getWriter();
        final JSONArray jsonArray = new JSONArray();
        for (final T next : list) {
            final JSONObject jsonObject = (JSONObject) JSONSerializer.toJSON(converter == null ? next : converter
                    .convert(next));
            jsonArray.element(jsonObject);
        }
        logger.debug(getStringUtils().removeHtmlTags(jsonArray.toString()));
        writer.print(jsonArray);
        writer.close();
    }
View Full Code Here


            final String placeHolder) throws IOException {
        final PrintWriter writer = response.getWriter();
        final JSONArray jsonArray = new JSONArray();
        for (final T next : list) {
            final JSONObject jsonObject = (JSONObject) JSONSerializer.toJSON(next);
            jsonArray.element(jsonObject);
        }

        final JSONObject jsonObjectOut = new JSONObject();
        jsonObjectOut.put(placeHolder, jsonArray);
        writer.print(jsonObjectOut);
View Full Code Here

        for (int i = 0; i < childCount; i++) {
            Node child = element.getChild(i);
            if (child instanceof Text) {
                Text text = (Text) child;
                if (StringUtils.isNotBlank(StringUtils.strip(text.getValue()))) {
                    jsonArray.element(text.getValue());
                }
            } else if (child instanceof Element) {
                setValue(jsonArray, (Element) child, defaultType);
            }
        }
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.