Examples of JsonFormatter


Examples of com.cedarsoftware.ncube.formatters.JsonFormatter

        return new HtmlFormatter(headers).format(this);
    }

    public String toFormattedJson()
    {
        return new JsonFormatter().format(this);
    }
View Full Code Here

Examples of com.cedarsoftware.ncube.formatters.JsonFormatter

        {
            PreparedStatement stmt = null;
            try
            {
                stmt = connection.prepareStatement("UPDATE n_cube SET cube_value_bin=?, update_dt=? WHERE app_cd = ? AND n_cube_nm = ? AND version_no_cd = ? AND status_cd = '" + ReleaseStatus.SNAPSHOT + "'");
                stmt.setBytes(1, new JsonFormatter().format(ncube).getBytes("UTF-8"));
                stmt.setDate(2, new java.sql.Date(System.currentTimeMillis()));
                stmt.setString(3, app);
                stmt.setString(4, ncube.getName());
                stmt.setString(5, version);
                int count = stmt.executeUpdate();
View Full Code Here

Examples of com.foundationdb.server.explain.format.JsonFormatter

    @Override
    public void explainSQL(PrintWriter writer, HttpServletRequest request, String sql) throws IOException, SQLException {
        ENTITY_EXPLAIN.in();
        try (JDBCConnection conn = jdbcConnection(request)) {
            new JsonFormatter().format(conn.explain(sql), writer);
        } finally {
            ENTITY_EXPLAIN.out();
        }
    }
View Full Code Here

Examples of com.foundationdb.server.explain.format.JsonFormatter

            BasePlannable result = compiler.compile((DMLStatementNode)innerStmt, params, context);
            explainable = result.getPlannable();
        }
        List<String> explain;
        if (compiler instanceof PostgresJsonCompiler) {
            JsonFormatter f = new JsonFormatter();
            explain = Collections.singletonList(f.format(explainable.getExplainer(context.getExplainContext())));
        }
        else {
            DefaultFormatter.LevelOfDetail detail;
            switch (explainStmt.getDetail()) {
            case BRIEF:
                detail = DefaultFormatter.LevelOfDetail.BRIEF;
                break;
            default:
            case NORMAL:
                detail = DefaultFormatter.LevelOfDetail.NORMAL;
                break;
            case VERBOSE:
                detail = DefaultFormatter.LevelOfDetail.VERBOSE;
                break;
            }
            DefaultFormatter f = new DefaultFormatter(server.getDefaultSchemaName(), detail);
            explain = f.format(explainable.getExplainer(context.getExplainContext()));
        }
        init(explain);
        compiler = null;
        return this;
    }
View Full Code Here

Examples of com.germinus.util.objectformatter.JsonFormatter

            List<Page> pages = pageDAO.getAll();

            if (scriptTag) {
                out.write(cb + "(");
            }
            JsonFormatter jsFmt = new JsonFormatter();
            jsFmt.setRootElement("page");
            out.print(jsFmt.convert(pages));
            if (scriptTag) {
                out.write(");");
            }
        } catch (DAOException ex) {
            Logger.getLogger(PageController.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

Examples of com.germinus.util.objectformatter.JsonFormatter

            List<Mashup> mashups = mashupDAO.getAll();

            if (scriptTag) {
                out.write(cb + "(");
            }
            JsonFormatter jsFmt = new JsonFormatter();
            jsFmt.setRootElement("mashup");
            out.print(jsFmt.convert(mashups));
            if (scriptTag) {
                out.write(");");
            }
        } catch (DAOException ex) {
            Logger.getLogger(MashupController.class.getName()).log(Level.SEVERE, null, ex);
View Full Code Here

Examples of com.germinus.util.objectformatter.JsonFormatter

            }
           
            OMR omr = new OMR();
            List<OMRService> omrServices = omr.searchServicesByQuery(null);
           
            JsonFormatter jsonFormatter = new JsonFormatter();
            jsonFormatter.setRootElement("services");
            String json = jsonFormatter.convert(omrServices);
           
            out.println(callback+"("+json+");");
        } catch (XmlException ex) {
            Logger.getLogger(OMRServlet.class.getName()).log(Level.SEVERE, null, ex);
            out.println("{error: 'Error retrieving services'}");
View Full Code Here

Examples of gherkin.formatter.JSONFormatter

        }

        final boolean reported = Boolean.parseBoolean(cukespaceConfig.getProperty(CucumberConfiguration.REPORTABLE, "false"));
        final StringBuilder reportBuilder = new StringBuilder();
        if (reported) {
            runtimeOptions.addFormatter(new JSONFormatter(reportBuilder));
        }

        final Collection<Class<?>> glues = new LinkedList<Class<?>>();
        final InputStream gluesIs = tccl.getResourceAsStream(ClientServerFiles.GLUES_LIST);
        if (gluesIs != null) {
View Full Code Here

Examples of lupos.endpoint.server.format.JSONFormatter

            Math.min(message.length(), MAX_DEBUG_LENGTH))));
    /*
     * get the JSON formatter, because we know, subgraphs are serialized in
     * JSON
     */
    final Formatter formatter = new JSONFormatter();

    /*
     * try to parse the message
     */
    P2PMessage msg = null;
View Full Code Here

Examples of lupos.endpoint.server.format.JSONFormatter

  public static void registerStandardFormatter(){
    Endpoint.registerFormatter(new XMLFormatter());
    Endpoint.registerFormatter(new XMLFormatter(true));
    Endpoint.registerFormatter(new PlainFormatter());
    Endpoint.registerFormatter(new JSONFormatter());
    Endpoint.registerFormatter(new JSONFormatter(true));
    Endpoint.registerFormatter(new CSVFormatter());
    Endpoint.registerFormatter(new TSVFormatter());
    Endpoint.registerFormatter(new HTMLFormatter(false));
    Endpoint.registerFormatter(new HTMLFormatter(true));
    Endpoint.registerFormatter(new HTMLFormatter(false, true));
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.