新增航班动态信息处理
This commit is contained in:
@@ -9,14 +9,18 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.ObjectWriter;
|
||||
|
||||
public class JsonUtil {
|
||||
public static String getString(Object object) throws JsonProcessingException
|
||||
public static String getString(Object object)
|
||||
{
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
|
||||
java.lang.String jsonStr = ow.writeValueAsString(object);
|
||||
|
||||
return jsonStr;
|
||||
}
|
||||
try {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
|
||||
java.lang.String jsonStr;
|
||||
jsonStr = ow.writeValueAsString(object);
|
||||
return jsonStr;
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} //end function
|
||||
|
||||
|
||||
public static <T> T getObject(String str,Class<T> valueType) throws JsonParseException, JsonMappingException, IOException
|
||||
|
||||
Reference in New Issue
Block a user