Class JSONQueryHandler


  • public final class JSONQueryHandler
    extends java.lang.Object
    Handle parsing JSON queries and template queries
    Author:
    Julie Sullivan
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static PathQuery parse​(Model model, java.lang.String jsonQueryString)
      Parse PathQuery from JSON
      static PathQuery parse​(TemplateQuery templateQuery, Model model, java.lang.String jsonQueryString)
      Parse PathQuery from JSON.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • parse

        public static PathQuery parse​(Model model,
                                      java.lang.String jsonQueryString)
                               throws org.json.JSONException
        Parse PathQuery from JSON
        Parameters:
        model - the data model
        jsonQueryString - the query in JSON format
        Returns:
        a Map from query name to PathQuery
        Throws:
        org.json.JSONException - if poorly formatted JSON
      • parse

        public static PathQuery parse​(TemplateQuery templateQuery,
                                      Model model,
                                      java.lang.String jsonQueryString)
                               throws org.json.JSONException
        Parse PathQuery from JSON. Handles template constraints too.
        Parameters:
        model - the data model
        jsonQueryString - the query in JSON format
        templateQuery - template associate with query. may be null.
        Returns:
        a Map from query name to PathQuery
        Throws:
        org.json.JSONException - if poorly formatted JSON