Class JacksonUtils
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.utils.json.JacksonUtils
-
public class JacksonUtils extends Object
Some utility methods to ease the transition from net.sf.json to Jackson.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJacksonUtils.JacksonUtilsException
-
Constructor Summary
Constructors Constructor Description JacksonUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetString(com.fasterxml.jackson.databind.JsonNode node, String name)static List<String>jsonArrayToStrings(com.fasterxml.jackson.databind.node.ArrayNode values)net.sf.json provided this method (assuming that 'values' is an array of JSON objects that contain Strings.static com.fasterxml.jackson.databind.JsonNodeparseJson(String json)net.sf.json could parse a JSON string without throwing a checked exception.static Stringquote(String raw)A "clean room" replacement for net.sf.json.util.JSONUtils.quote().
-
-
-
Method Detail
-
quote
public static String quote(String raw)
A "clean room" replacement for net.sf.json.util.JSONUtils.quote().
-
parseJson
public static com.fasterxml.jackson.databind.JsonNode parseJson(String json)
net.sf.json could parse a JSON string without throwing a checked exception. Make it so we can do the same with Jackson.
-
jsonArrayToStrings
public static List<String> jsonArrayToStrings(com.fasterxml.jackson.databind.node.ArrayNode values)
net.sf.json provided this method (assuming that 'values' is an array of JSON objects that contain Strings. literalValues = (List) JSONSerializer.toJava(values); So here is a replacement for that.
-
-