Examples of serializeJson()


Examples of org.carrot2.core.ProcessingResult.serializeJson()

        }

        try
        {
            StringWriter sw = new StringWriter();
            pr.serializeJson(sw, "updateDataJson", true, false, true, false);

            String json = sw.toString();
            logger.info("Updating view XML: " +
                StringUtils.abbreviate(json, 180));
View Full Code Here

Examples of org.carrot2.core.ProcessingResult.serializeJson()

            processingAttributes, LuceneDocumentSource.class);
        assertThat(result.getDocuments().size()).as("Number of results").isEqualTo(
            results);

        final StringWriter json = new StringWriter();
        result.serializeJson(json);
        assertThat(json.toString()).doesNotContain("\"luceneDocument\"");

        final ByteArrayOutputStream xml = new ByteArrayOutputStream();
        result.serialize(xml);
        assertThat(xml.toString("UTF-8")).doesNotContain(
View Full Code Here

Examples of org.carrot2.core.ProcessingResult.serializeJson()

                    !requestModel.clustersOnly, true);
            }
            else if (OutputFormat.JSON.equals(requestModel.outputFormat))
            {
                response.setContentType(MIME_JSON_UTF8);
                result.serializeJson(response.getWriter(), requestModel.jsonCallback,
                    !requestModel.clustersOnly, true);
            }
            else
            {
                response.sendError(HttpServletResponse.SC_BAD_REQUEST,
View Full Code Here

Examples of org.carrot2.core.ProcessingResult.serializeJson()

        final ProcessingResult result = controller.process(attributes,
            LingoClusteringAlgorithm.class);

        // Now, we can serialize the entire result to XML like this
        result.serializeJson(new PrintWriter(System.out));
        System.out.println();

        // Optionally, we can provide a callback for JSON-P-style calls
        result.serializeJson(
            new PrintWriter(System.out), "loadResults",
View Full Code Here

Examples of org.carrot2.core.ProcessingResult.serializeJson()

        // Now, we can serialize the entire result to XML like this
        result.serializeJson(new PrintWriter(System.out));
        System.out.println();

        // Optionally, we can provide a callback for JSON-P-style calls
        result.serializeJson(
            new PrintWriter(System.out), "loadResults",
            true /* indent */,
            false /* save documents */,
            true /* save clusters */);

 
View Full Code Here

Examples of org.carrot2.core.ProcessingResult.serializeJson()

            try
            {
                if (Format.JSON.equals(outputFormat))
                {
                    Writer w = new OutputStreamWriter(stream, "UTF-8");
                    result.serializeJson(w, null, outputDocuments, true, outputAttributes);
                    w.flush();
                }
                else
                {
                    result.serialize(stream, outputDocuments, true, outputAttributes);
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.