class JSONUtil {

	public Map<String, String> jsonToMap(String jsonStr) {
		if (jsonStr == null || jsonStr.isEmpty()) {
			return new HashMap<String, String>();
		}

		ObjectMapper mapper = new ObjectMapper();
		try {
			Map<String, String> tempObject = mapper.readValue(jsonStr,
					new TypeReference<Map<String, String>>() {
					});
			return tempObject;

		} catch (JsonParseException e) {
			throw restErrorUtil.createRESTException(
					"Invalid input data: " + e.getMessage(),
					MessageEnums.INVALID_INPUT_DATA);
		} catch (JsonMappingException e) {
			throw restErrorUtil.createRESTException(
					"Invalid input data: " + e.getMessage(),
					MessageEnums.INVALID_INPUT_DATA);
		} catch (IOException e) {
			throw restErrorUtil.createRESTException(
					"Invalid input data: " + e.getMessage(),
					MessageEnums.INVALID_INPUT_DATA);
		}

	}

}