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

com.lordofthejars.nosqlunit.hbase.model.JsonDataSetParser Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package com.lordofthejars.nosqlunit.hbase.model;

import java.io.IOException;
import java.io.InputStream;

import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;

public class JsonDataSetParser implements DataSetParser {

	public ParsedDataModel parse(InputStream inputStream) {
		
		ObjectMapper mapper = new ObjectMapper();
		
		try {
			return mapper.readValue(inputStream, ParsedDataModel.class);
		} catch (JsonParseException e) {
			throw new IllegalArgumentException(e);
		} catch (JsonMappingException e) {
			throw new IllegalArgumentException(e);
		} catch (IOException e) {
			throw new IllegalArgumentException(e);
		}
		
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy