package mobvista.dmp.common;

import java.io.IOException;
import java.util.List;

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

public class ListPraser {
 public List<String> getList(String str){
	 ObjectMapper objectMapper = new ObjectMapper();
	 JavaType listStringType = objectMapper.getTypeFactory().constructCollectionType(List.class, String.class);
	 try {
		List<String> categoryIdList = objectMapper.readValue(str, listStringType);
		return categoryIdList;
	} catch (JsonParseException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} catch (JsonMappingException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	} catch (IOException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	 System.out.println("exception_parse_str:"+str);
	 return null;
 }
}
