Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.ObjectMapper.canSerialize()


   
        Simple s = new Simple();
        s.setList(l);

        // this is fine:
        boolean can = mapper.canSerialize(Simple.class);
        assertTrue(can);

        // but with problem of [JACKSON-540], we get nasty surprise here...
        String json = mapper.writeValueAsString(s);
       
View Full Code Here


   
        Simple s = new Simple();
        s.setList(l);

        // this is fine:
        boolean can = mapper.canSerialize(Simple.class);
        assertTrue(can);

        // but with problem of [JACKSON-540], we get nasty surprise here...
        String json = mapper.writeValueAsString(s);
       
View Full Code Here

  @Test
  public void registersJodaModuleAutomatically() {
    this.context.register(JacksonAutoConfiguration.class);
    this.context.refresh();
    ObjectMapper objectMapper = this.context.getBean(ObjectMapper.class);
    assertThat(objectMapper.canSerialize(LocalDateTime.class), is(true));
  }

  @Test
  public void customJacksonModules() throws Exception {
    this.context.register(ModulesConfig.class, JacksonAutoConfiguration.class);
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.