Examples of addDeserializer()


Examples of com.fasterxml.jackson.databind.module.SimpleModule.addDeserializer()

    }

    private ObjectMapper createObjectMapper() {
        SimpleModule module = new SimpleModule("MySimpleModule", new Version(1,
                0, 0, null, "", ""));
        module.addDeserializer(Custom.class, new JsonDeserializer<Custom>() {
            @Override
            public Custom deserialize(JsonParser jp, DeserializationContext ctxt)
                    throws IOException {
                JsonNode node = jp.readValueAsTree();
                return new Custom(node.get("v1").asText(), node.get("v2")
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule.addDeserializer()

        } else {
            try {
                NodeStats.UndefinedStatDeserializer usd = new NodeStats.UndefinedStatDeserializer();
                SimpleModule module = new SimpleModule("UndefinedStatDeserializer",
                                                       new Version(1,0,0,null,null,null));
                module.addDeserializer(BigInteger.class, usd);
                return new ObjectMapper().registerModule(module).readValue(r.getBodyAsString(), NodeStats.class);
            } catch (IOException e) {
                throw new IOException("Could not parse stats JSON response, body: " + r.getBodyAsString(),e);
            }
        }
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule.addDeserializer()

        init(objectMapper);
    }

    protected void init(ObjectMapper objectMapper) {
        SimpleModule module = new SimpleModule("EventDeserializerModule", new Version(1, 0, 0, null, null, null));
        module.addDeserializer(Event.class, eventDeserializer);
        module.addDeserializer(JsonObject.class, jsonObjectDeserializer);
        module.addDeserializer(AckArgs.class, ackArgsDeserializer);
        objectMapper.registerModule(module);

        objectMapper.setSerializationInclusion(Include.NON_NULL);
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule.addDeserializer()

    }

    protected void init(ObjectMapper objectMapper) {
        SimpleModule module = new SimpleModule("EventDeserializerModule", new Version(1, 0, 0, null, null, null));
        module.addDeserializer(Event.class, eventDeserializer);
        module.addDeserializer(JsonObject.class, jsonObjectDeserializer);
        module.addDeserializer(AckArgs.class, ackArgsDeserializer);
        objectMapper.registerModule(module);

        objectMapper.setSerializationInclusion(Include.NON_NULL);
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule.addDeserializer()

    protected void init(ObjectMapper objectMapper) {
        SimpleModule module = new SimpleModule("EventDeserializerModule", new Version(1, 0, 0, null, null, null));
        module.addDeserializer(Event.class, eventDeserializer);
        module.addDeserializer(JsonObject.class, jsonObjectDeserializer);
        module.addDeserializer(AckArgs.class, ackArgsDeserializer);
        objectMapper.registerModule(module);

        objectMapper.setSerializationInclusion(Include.NON_NULL);

//        TODO If jsonObjectDeserializer will be not enough
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule.addDeserializer()

        jsonpObjectMapper.getFactory().setCharacterEscapes(new HTMLCharacterEscapes());
    }

    protected void init(ObjectMapper objectMapper) {
        SimpleModule module = new SimpleModule();
        module.addDeserializer(Event.class, eventDeserializer);
        module.addDeserializer(AckArgs.class, ackArgsDeserializer);
        objectMapper.registerModule(module);

        objectMapper.setSerializationInclusion(Include.NON_NULL);
        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule.addDeserializer()

    }

    protected void init(ObjectMapper objectMapper) {
        SimpleModule module = new SimpleModule();
        module.addDeserializer(Event.class, eventDeserializer);
        module.addDeserializer(AckArgs.class, ackArgsDeserializer);
        objectMapper.registerModule(module);

        objectMapper.setSerializationInclusion(Include.NON_NULL);
        objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        objectMapper.configure(SerializationFeature.WRITE_BIGDECIMAL_AS_PLAIN, true);
View Full Code Here

Examples of com.fasterxml.jackson.databind.module.SimpleModule.addDeserializer()

    //

    final Class<DecimalValue> klazDecimal = DecimalValue.class;
    module.addSerializer(new DecimalValueSer(klazDecimal));
    module.addDeserializer(klazDecimal, new DecimalValueDes(klazDecimal));

    //

    final Class<PriceValue> klazPrice = PriceValue.class;
    module.addSerializer(new PriceValueSer(klazPrice));
View Full Code Here

Examples of org.codehaus.jackson.map.module.SimpleDeserializers.addDeserializer()

                        }
                        if (xmlAdapter != null) {
                            XmlAdapterJsonDeserializer deserializer = new XmlAdapterJsonDeserializer(xmlAdapter);
                            XmlAdapterJsonSerializer serializer = new XmlAdapterJsonSerializer(xmlAdapter);
                            SimpleDeserializers deserializers = new SimpleDeserializers();
                            deserializers.addDeserializer(a.type(), deserializer);
                            deserializerFactory.withAdditionalDeserializers(deserializers);
                            serializerFactory.addGenericMapping(a.type(), serializer);
                            StdDeserializerProvider deserializerProvider =
                                new StdDeserializerProvider(deserializerFactory);
                            mapper = new ObjectMapper();
View Full Code Here

Examples of org.codehaus.jackson.map.module.SimpleModule.addDeserializer()

    // Setup custom serdes for simple data types.
    module.addSerializer(Partition.class, new PartitionSerializer());
    module.addSerializer(SystemStreamPartition.class, new SystemStreamPartitionSerializer());
    module.addSerializer(TaskName.class, new TaskNameSerializer());
    module.addDeserializer(Partition.class, new PartitionDeserializer());
    module.addDeserializer(SystemStreamPartition.class, new SystemStreamPartitionDeserializer());
    module.addDeserializer(Config.class, new ConfigDeserializer());

    // Setup mixins for data models.
    mapper.getSerializationConfig().addMixInAnnotations(TaskModel.class, JsonTaskModelMixIn.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.