Package com.avaje.ebeaninternal.api

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


   
    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

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.