Examples of SimpleModule


Examples of com.facebook.presto.jdbc.internal.jackson.databind.module.SimpleModule

        objectMapper.disable(MapperFeature.AUTO_DETECT_IS_GETTERS);
        objectMapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
        objectMapper.disable(MapperFeature.CAN_OVERRIDE_ACCESS_MODIFIERS);

        if (jsonSerializers != null || jsonDeserializers != null || keySerializers != null || keyDeserializers != null) {
            SimpleModule module = new SimpleModule(getClass().getName(), new Version(1, 0, 0, null));
            if (jsonSerializers != null) {
                for (Entry<Class<?>, JsonSerializer<?>> entry : jsonSerializers.entrySet()) {
                    addSerializer(module, entry.getKey(), entry.getValue());
                }
            }
            if (jsonDeserializers != null) {
                for (Entry<Class<?>, JsonDeserializer<?>> entry : jsonDeserializers.entrySet()) {
                    addDeserializer(module, entry.getKey(), entry.getValue());
                }
            }
            if (keySerializers != null) {
                for (Entry<Class<?>, JsonSerializer<?>> entry : keySerializers.entrySet()) {
                    addKeySerializer(module, entry.getKey(), entry.getValue());
                }
            }
            if (keyDeserializers != null) {
                for (Entry<Class<?>, KeyDeserializer> entry : keyDeserializers.entrySet()) {
                    module.addKeyDeserializer(entry.getKey(), entry.getValue());
                }
            }
            modules.add(module);
        }
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule

    if (this.dateFormat != null) {
      this.objectMapper.setDateFormat(this.dateFormat);
    }

    if (this.serializers != null || this.deserializers != null) {
      SimpleModule module = new SimpleModule();
      addSerializers(module);
      addDeserializers(module);
      this.objectMapper.registerModule(module);
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule

                                    return Optional.absent();
                                }
                            }
                        }
                );
        simpleModule = new SimpleModule() {
            {
                addSerializer(new NodeIdSerializer());
            }
        };
        this.mapper.registerModule(simpleModule);
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule

        objectMapper = new ObjectMapper()
                .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
                .setPropertyNamingStrategy(new PreserveLeadingUnderscoreStrategy())
                .registerModule(new JodaModule())
                .registerModule(new GuavaModule())
                .registerModule(new SimpleModule().addSerializer(new RangeJsonSerializer()));
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule

    @Inject
    public ServerObjectMapperProvider(final ObjectMapperProvider objectMapperProvider) {
        this.objectMapper = objectMapperProvider.get()
                .copy()
                .registerModule(new SimpleModule().addSerializer(new ObjectIdSerializer()));
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule

    @Test
    public void testPolymorphicJacksonSerializationAndDeserialization()
    {
        ObjectMapper mapper = new ObjectMapper();

        SimpleModule testModule = new SimpleModule("testModule", new Version(1, 0, 0, null, null, null))
                .addDeserializer( QueryFilter.class, new QueryFilterDeserializer() )
                .addSerializer( LogicalFilter2.class, new LogicalFilter2Serializer() );

        mapper.registerModule(testModule);
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule

  private ObjectMapper mapper;

  public GimpleParser() {
    super();

    SimpleModule gimpleModule = new SimpleModule("Gimple", Version.unknownVersion()).addDeserializer(GimpleOp.class,
        new GimpleOpDeserializer());

    mapper = new ObjectMapper();
    mapper.registerModule(gimpleModule);
  }
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule

    @Test
    public void testPolymorphicJacksonSerializationAndDeserialization()
    {
        ObjectMapper mapper = new ObjectMapper();

        SimpleModule testModule = new SimpleModule("testModule", new Version(1, 0, 0, null, null, null))
                .addDeserializer( QueryFilter5.class, new QueryFilter5Deserializer() );

        mapper.registerModule(testModule);

        // Verifying that we can pass in a custom Mapper and create a new JsonUtil
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule

    @Test
    public void testPolymorphicJacksonSerializationAndDeserialization()
    {
        ObjectMapper mapper = new ObjectMapper();

        SimpleModule testModule = new SimpleModule("testModule", new Version(1, 0, 0, null, null, null))
                .addDeserializer( QueryFilter4.class, new QueryFilter4Deserializer() );

        mapper.registerModule(testModule);

        // Verifying that we can pass in a custom Mapper and create a new JsonUtil
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule

    @Test
    public void testPolymorphicJacksonSerializationAndDeserialization()
    {
        ObjectMapper mapper = new ObjectMapper();

        SimpleModule testModule = new SimpleModule("testModule", new Version(1, 0, 0, null, null, null))
                .addDeserializer( QueryFilter.class, new QueryFilter1Deserializer() );

        mapper.registerModule(testModule);

        // Verifying that we can pass in a custom Mapper and create a new JsonUtil
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.