Class JSONPath


  • public class JSONPath
    extends Object
    JSONPath
    • Constructor Detail

      • JSONPath

        public JSONPath()
    • Method Detail

      • addContentItem

        public JSONPath addContentItem​(String contentItem)
      • getContent

        public List<String> getContent()
        Get content
        Returns:
        content
      • setContent

        public void setContent​(List<String> content)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • validateJsonObject

        public static void validateJsonObject​(com.google.gson.JsonObject jsonObj)
                                       throws IOException
        Throws:
        IOException
      • validateJsonObject

        public static void validateJsonObject​(com.google.gson.JsonObject jsonObj,
                                              boolean strictValidation)
                                       throws IOException
        Validates the JSON Object and throws an exception if issues found
        Parameters:
        jsonObj - JSON Object
        strictValidation - reject (new) fields missing from the specifications
        Throws:
        IOException - if the JSON Object is invalid with respect to JSONPath
      • fromJson

        public static JSONPath fromJson​(String jsonString)
                                 throws IOException
        Create an instance of JSONPath given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of JSONPath
        Throws:
        IOException - if the JSON string is invalid with respect to JSONPath
      • toJson

        public String toJson()
        Convert an instance of JSONPath to an JSON string
        Returns:
        JSON string