objectMapper = new ObjectMapper(jsonFactory);
}
for (final Map.Entry<String, String> e : deserializationFeatures.entrySet()) {
final String key = e.getKey();
final String value = e.getValue();
final DeserializationFeature feature;
try {
feature = DeserializationFeature.valueOf(key);
} catch (final Exception e1) {
throw SupportLogger.LOGGER.unrecognizedReaderWriterProperty(key, value);
}
if ("true".equals(value)) {
if (!feature.enabledByDefault()) {
objectMapper.configure(feature, true);
}
} else if ("false".equals(value)) {
if (feature.enabledByDefault()) {
objectMapper.configure(feature, false);
}
} else {
throw SupportLogger.LOGGER.invalidReaderWriterProperty(value, key);
}
}
}
registerModule();
jsonParser = jsonFactory.createParser(getInputReader(false));
if (objectMapper != null) {
jsonParser.setCodec(objectMapper);
}
SupportLogger.LOGGER.openingResource(resource, this.getClass());
if (jsonParserFeatures != null) {
for (final Map.Entry<String, String> e : jsonParserFeatures.entrySet()) {
final String key = e.getKey();
final String value = e.getValue();
final JsonParser.Feature feature;
try {
feature = JsonParser.Feature.valueOf(key);
} catch (final Exception e1) {
throw SupportLogger.LOGGER.unrecognizedReaderWriterProperty(key, value);
}
if ("true".equals(value)) {
if (!feature.enabledByDefault()) {
jsonParser.configure(feature, true);
}
} else if ("false".equals(value)) {
if (feature.enabledByDefault()) {
jsonParser.configure(feature, false);
}
} else {
throw SupportLogger.LOGGER.invalidReaderWriterProperty(value, key);
}