Class PathQueryBuilderForJSONObj


  • public class PathQueryBuilderForJSONObj
    extends PathQueryBuilder
    Author:
    Alexis Kalderimis
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> getAlteredViews​(PathQuery pq)
      Get the views for the transformed query.
      PathQuery getQuery()
      For the purposes of exporting into JSON objects the view must be: Ordered by length, such that Company.departments.name precedes Company.departments.employees.name Be constituted so that every class has an attribute on it, root class included, and every reference along the way.
      static PathQuery processQuery​(PathQuery beforeChanges)
      Transform a query from a standard one into one that conforms to the requirements of JSON objects.
      • Methods inherited from class java.lang.Object

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

      • PathQueryBuilderForJSONObj

        protected PathQueryBuilderForJSONObj()
        Constructor.
      • PathQueryBuilderForJSONObj

        public PathQueryBuilderForJSONObj​(java.lang.String xml,
                                          java.lang.String schemaUrl,
                                          Producer<java.util.Map<java.lang.String,​InterMineBag>> savedBags)
        Constructor
        Parameters:
        xml - The XML to build into a query.
        schemaUrl - The schema to validate against.
        savedBags - A map of bags this query may contain.
    • Method Detail

      • getQuery

        public PathQuery getQuery()
        For the purposes of exporting into JSON objects the view must be:
        • Ordered by length, such that Company.departments.name precedes Company.departments.employees.name
        • Be constituted so that every class has an attribute on it, root class included, and every reference along the way. So a path such as Departments.employees.address.address is illegal unless it is preceded by Departments.id and Departments.employees.id (id is the default if none is supplied).
        The purpose of this method is to perform the necessary transformations.
        Overrides:
        getQuery in class PathQueryBuilder
        Returns:
        a PathQuery with an appropriately mangled view.
      • processQuery

        public static PathQuery processQuery​(PathQuery beforeChanges)
        Transform a query from a standard one into one that conforms to the requirements of JSON objects.
        Parameters:
        beforeChanges - The query to transform.
        Returns:
        A transformed query.
      • getAlteredViews

        public static java.util.List<java.lang.String> getAlteredViews​(PathQuery pq)
        Get the views for the transformed query.
        Parameters:
        pq - The original query.
        Returns:
        Its new views.