Class JacksonUtils


  • public class JacksonUtils
    extends Object
    Some utility methods to ease the transition from net.sf.json to Jackson.
    • Constructor Detail

      • JacksonUtils

        public JacksonUtils()
    • 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.
      • getString

        public static String getString​(com.fasterxml.jackson.databind.JsonNode node,
                                       String name)