Examples of JodaModule


Examples of com.fasterxml.jackson.datatype.joda.JodaModule

    protected void configureMapper() {
        MAPPER.setDateFormat(new SimpleDateFormat(DATE_FORMAT));
        MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        MAPPER.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
        MAPPER.registerModule(new JodaModule());
    }
View Full Code Here

Examples of com.fasterxml.jackson.datatype.joda.JodaModule

    public ObjectMapperProvider()
    {
        // add modules for Guava and Joda
        modules.add(new GuavaModule());
        modules.add(new JodaModule());
    }
View Full Code Here

Examples of com.fasterxml.jackson.datatype.joda.JodaModule

   * 但JodaTime仍然只支持Timestamp形式, 或调用JodaTime.toString().
   */
  @Test
  public void dateType() {

    mapper.getMapper().registerModule(new JodaModule());

    Date date = new Date();
    DateTime dateTime = new DateTime(date);
    String timestampString = String.valueOf(date.getTime());
    String format = "yyyy-MM-dd HH:mm:ss";
View Full Code Here

Examples of com.fasterxml.jackson.datatype.joda.JodaModule

   
    // Needed for o.a. JsonFileState
    mapper.configure(JsonGenerator.Feature.AUTO_CLOSE_TARGET, false);
    mapper.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false);
   
    mapper.registerModule(new JodaModule());
   
    return mapper;
  }
View Full Code Here

Examples of com.fasterxml.jackson.datatype.joda.JodaModule

    public ObjectMapperProvider()
    {
        // add modules for Guava and Joda
        modules.add(new GuavaModule());
        modules.add(new JodaModule());
    }
View Full Code Here

Examples of com.fasterxml.jackson.datatype.joda.JodaModule

    }

    public static ObjectMapper registerExtraModules(ObjectMapper objectMapper) {
        objectMapper.registerModule(new GuavaModule());
        objectMapper.registerModule(new Jdk7Module());
        objectMapper.registerModule(new JodaModule());
        return objectMapper;
    }
View Full Code Here

Examples of com.fasterxml.jackson.datatype.joda.JodaModule

    public ObjectMapperProvider()
    {
        // add modules for Guava and Joda
        modules.add(new GuavaModule());
        modules.add(new JodaModule());
    }
View Full Code Here

Examples of com.fasterxml.jackson.datatype.joda.JodaModule

    }

    public static ObjectMapper registerExtraModules(ObjectMapper objectMapper) {
        objectMapper.registerModule(new GuavaModule());
        objectMapper.registerModule(new Jdk7Module());
        objectMapper.registerModule(new JodaModule());
        return objectMapper;
    }
View Full Code Here

Examples of com.fasterxml.jackson.datatype.joda.JodaModule

        this.defaultKey = defaultKey;
        this.usermetaConverter = new UsermetaConverter<T>();
        this.riakIndexConverter = new RiakIndexConverter<T>();
        this.riakLinksConverter = new RiakLinksConverter<T>();
        objectMapper.registerModule(new RiakJacksonModule());
        objectMapper.registerModule(new JodaModule());
    }
View Full Code Here

Examples of com.fasterxml.jackson.datatype.joda.JodaModule

public class DefaultObjectMapperFactory implements ObjectMapperFactory {

  @Override
  public ObjectMapper createInstance() {
    final ObjectMapper mapper = new ObjectMapper();
    mapper.registerModule(new JodaModule());

    mapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
    mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, false);
    mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, false);
    mapper.configure(
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.