All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vwo.JacksonParser Maven / Gradle / Ivy

There is a newer version: 1.66.0
Show newest version
package com.vwo;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.vwo.config.ConfigParseException;
import com.vwo.logger.LoggerManager;
import com.vwo.models.SettingFileConfig;

import java.io.IOException;

public class JacksonParser implements Parser {
  private ObjectMapper objectMapper;
  private static final LoggerManager LOGGER = LoggerManager.getLogger(JacksonParser.class);

  public JacksonParser(ObjectMapper objectMapper) {
    this.objectMapper = objectMapper;
  }

  public SettingFileConfig isValid(String settingFile) throws ConfigParseException {
    try {
      SettingFileConfig settingFileConfig = objectMapper.readValue(settingFile, SettingFileConfig.class);
      return settingFileConfig;
    } catch (IOException e) {
      throw new ConfigParseException("Unable to parse Setting file: " + settingFile, e);
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy