Package org.codehaus.jackson.map

Examples of org.codehaus.jackson.map.DeserializationConfig


    SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
    dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));

    serConfig.setDateFormat(dateFormat);

    DeserializationConfig deserializationConfig = mapper.getDeserializationConfig();
    deserializationConfig.setDateFormat(dateFormat);

    mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
  }
View Full Code Here


  public T deserialize(byte[] bytes) throws PropertyStoreException
  {
    ObjectMapper mapper = new ObjectMapper();
    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);

    DeserializationConfig deserializationConfig = mapper.getDeserializationConfig();
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_FIELDS, true);
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_SETTERS, true);
    deserializationConfig.set(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES,
                              true);
    try
    {
      T value = mapper.readValue(bais, _clazz);
      return value;
View Full Code Here

    }

    ObjectMapper mapper = new ObjectMapper();
    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);

    DeserializationConfig deserializationConfig = mapper.getDeserializationConfig();
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_FIELDS, true);
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_SETTERS, true);
    deserializationConfig.set(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, true);
    try
    {
      ZNRecord zn = mapper.readValue(bais, ZNRecord.class);
      return zn;
    } catch (Exception e)
View Full Code Here

  @Override
  public T deserialize(byte[] bytes) throws PropertyStoreException {
    ObjectMapper mapper = new ObjectMapper();
    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);

    DeserializationConfig deserializationConfig = mapper.getDeserializationConfig();
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_FIELDS, true);
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_SETTERS, true);
    deserializationConfig.set(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, true);
    try {
      T value = mapper.readValue(bais, _clazz);
      return value;
    } catch (Exception e) {
      LOG.error("Error during deserialization of bytes: " + new String(bytes), e);
View Full Code Here

    }

    ObjectMapper mapper = new ObjectMapper();
    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);

    DeserializationConfig deserializationConfig = mapper.getDeserializationConfig();
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_FIELDS, true);
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_SETTERS, true);
    deserializationConfig.set(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, true);
    try {
      T payload = mapper.readValue(bais, clazz);
      return payload;
    } catch (Exception e) {
      logger.error("Exception during deserialization of payload bytes: " + new String(bytes), e);
View Full Code Here

    }

    ObjectMapper mapper = new ObjectMapper();
    ByteArrayInputStream bais = new ByteArrayInputStream(bytes);

    DeserializationConfig deserializationConfig = mapper.getDeserializationConfig();
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_FIELDS, true);
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_SETTERS, true);
    deserializationConfig.set(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, true);
    try {
      ZNRecord zn = mapper.readValue(bais, ZNRecord.class);
      return zn;
    } catch (Exception e) {
      logger.error("Exception during deserialization of bytes: " + new String(bytes), e);
View Full Code Here

    }

    ObjectMapper mapper = new ObjectMapper();
    ByteArrayInputStream bais = new ByteArrayInputStream(string.getBytes());

    DeserializationConfig deserializationConfig = mapper.getDeserializationConfig();
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_FIELDS, true);
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_SETTERS, true);
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_CREATORS, true);
    deserializationConfig.set(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS, true);
    try {
      T payload = mapper.readValue(bais, clazz);
      return payload;
    } catch (Exception e) {
      logger.error("Exception during deserialization of payload bytes: " + string, e);
View Full Code Here

            objectMapper.setSerializationConfig(serializationConfig);
        }

        // Deserialization configuration
        if (MapUtils.isNotEmpty(deserializationFeatures)) {
            DeserializationConfig deserializationConfig = objectMapper.copyDeserializationConfig();
            for (Map.Entry<DeserializationConfig.Feature, Boolean> entry : deserializationFeatures.entrySet()) {
                DeserializationConfig.Feature feature = entry.getKey();
                boolean enabled = BooleanUtils.isTrue(entry.getValue());
                if (enabled) {
                    deserializationConfig = deserializationConfig.with(feature);
                } else {
                    deserializationConfig = deserializationConfig.without(feature);
                }
            }
            objectMapper.setDeserializationConfig(deserializationConfig);
        }
    }
View Full Code Here

        SerializationConfig serializationConfig =
            mapper.getSerializationConfig().withSerializationInclusion(Inclusion.NON_NULL).withAnnotationIntrospector(pair);
           //.withDateFormat(StdDateFormat.getBlueprintISO8601Format());


        DeserializationConfig deserializationConfig =
            mapper.getDeserializationConfig().without(Feature.FAIL_ON_UNKNOWN_PROPERTIES).withAnnotationIntrospector(pair);
            //.withDateFormat(StdDateFormat.getBlueprintISO8601Format());

        mapper.setSerializationConfig(serializationConfig);
        mapper.setDeserializationConfig(deserializationConfig);
View Full Code Here

    }

    ObjectMapper mapper = new ObjectMapper();
    ByteArrayInputStream bais = new ByteArrayInputStream(string.getBytes());

    DeserializationConfig deserializationConfig = mapper.getDeserializationConfig();
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_FIELDS, true);
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_SETTERS, true);
    deserializationConfig.set(DeserializationConfig.Feature.AUTO_DETECT_CREATORS, true);
    deserializationConfig.set(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, true);
    deserializationConfig.set(DeserializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS, true);
    try {
      T payload = mapper.readValue(bais, clazz);
      return payload;
    } catch (Exception e) {
      logger.error("Exception during deserialization of payload bytes: " + string, e);
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.map.DeserializationConfig

Copyright © 2018 www.massapicom. 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.