Examples of json()


Examples of com.avaje.ebean.EbeanServer.json()

    // newDetail.setOrder(order);
    order.addDetail(newDetail);

    EbeanServer server = Ebean.getServer(null);

    JsonContext jsonContext = server.json();
    String jsonString = jsonContext.toJson(order);
    System.out.println(jsonString);

    Order updOrder = jsonContext.toBean(Order.class, jsonString);
View Full Code Here

Examples of com.avaje.ebean.EbeanServer.json()

        .fetch("contacts", "firstName,email")
        .order().desc("id").findList();

    EbeanServer server = Ebean.getServer(null);

    JsonContext json = server.json();

    String jsonOutput = json.toJson(list);
    System.out.println(jsonOutput);

    List<Customer> mList = json.toList(Customer.class, jsonOutput);
View Full Code Here

Examples of com.avaje.ebean.EbeanServer.json()

    List<Customer> list = Ebean.find(Customer.class).select("id, name").order().desc("id")
        .findList();

    EbeanServer server = Ebean.getServer(null);

    JsonContext json = server.json();

    if (list.size() > 1) {
      Customer customer = list.get(0);

      String s = json.toJson(customer);
View Full Code Here

Examples of com.avaje.ebeaninternal.api.SpiEbeanServer.json()

       
        ElPropertyValue elCmoney = descriptor.getElGetValue("cmoney");
//        ElPropertyValue elCmoneyAmt = descriptor.getElGetValue("cmoney.amount");
//        ElPropertyValue elCmoneyCur = descriptor.getElGetValue("cmoney.currency");
       
        JsonContext jsonContext = server.json();
        String json = jsonContext.toJson(p);
       
        DPerson bean = jsonContext.toBean(DPerson.class, json);
        Assert.assertEquals("first", bean.getFirstName());
        Assert.assertEquals(new Money("12200"), bean.getSalary());
View Full Code Here

Examples of com.avaje.ebeaninternal.api.SpiEbeanServer.json()

   
    BeanDescriptor<Customer> descriptor = server.getBeanDescriptor(Customer.class);
   
   
    StringReader reader = new StringReader("{\"id\":123,\"name\":\"Hello rob\"}");
    JsonParser parser = server.json().createParser(reader);
   
    Customer customer = (Customer)descriptor.jsonRead(parser, null);
   
    Assert.assertEquals(Integer.valueOf(123), customer.getId());
    Assert.assertEquals("Hello rob", customer.getName());
View Full Code Here

Examples of com.googlecode.jslint4java.JSLintResult.ResultBuilder.json()

                    Scriptable data = (Scriptable) reportFunc.call(cx, lintFunc, null,
                            Context.emptyArgs);
                    for (String global : Util.listValueOfType("global", String.class, data)) {
                        b.addGlobal(global);
                    }
                    b.json(Util.booleanValue("json", data));
                    for (JSFunction f : Util.listValue("functions", data, new JSFunctionConverter())) {
                        b.addFunction(f);
                    }
                }
View Full Code Here

Examples of com.jcabi.github.Content.json()

        final Content content = contents.create(
            jsonContent(path, "for json", "json test")
        );
        MatcherAssert.assertThat(
            // @checkstyle MultipleStringLiterals (1 line)
            content.json().getString("name"),
            Matchers.is(path)
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.DeployKey.json()

    @Test
    public void canRepresentAsJson() throws Exception {
        final DeployKeys keys = MkDeployKeysTest.repo().keys();
        final DeployKey first = keys.create("Title4", "Key4");
        MatcherAssert.assertThat(
            first.json().toString(),
            Matchers.allOf(
                Matchers.containsString("\"title\":\"Title4\""),
                Matchers.containsString("\"key\":\"Key4\"")
            )
        );
View Full Code Here

Examples of com.jcabi.github.Fork.json()

     */
    @Test
    public void fetchAsJson() throws Exception {
        final Fork fork = forks().create("fork");
        MatcherAssert.assertThat(
            fork.json().toString(),
            Matchers.containsString("{")
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.Limit.Throttled.json()

        final Limit limit = Mockito.mock(Limit.class);
        final Throttled throttled = new Throttled(limit, 23);
        Mockito.when(limit.json()).thenReturn(
            Json.createObjectBuilder().add("absent", "absentValue").build()
        );
        throttled.json();
    }

}
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.