Class PathQueryBuilderForJSONObj
- java.lang.Object
-
- org.intermine.webservice.server.query.result.PathQueryBuilder
-
- org.intermine.webservice.server.query.result.PathQueryBuilderForJSONObj
-
public class PathQueryBuilderForJSONObj extends PathQueryBuilder
- Author:
- Alexis Kalderimis
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedPathQueryBuilderForJSONObj()Constructor.PathQueryBuilderForJSONObj(java.lang.String xml, java.lang.String schemaUrl, Producer<java.util.Map<java.lang.String,InterMineBag>> savedBags)Constructor
-
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.PathQuerygetQuery()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 PathQueryprocessQuery(PathQuery beforeChanges)Transform a query from a standard one into one that conforms to the requirements of JSON objects.
-
-
-
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).
- Overrides:
getQueryin classPathQueryBuilder- 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.
-
-