code: public static void loadSortListFromJSONArray(
              List<AbstractExpression> sortExpressions,
              List<SortDirectionType> sortDirections,
              JSONObject jobj) throws JSONException {
          if (jobj.has(SortMembers.SORT_COLUMNS)) {
              sortExpressions.clear();
              if (sortDirections != null) {
                  sortDirections.clear();
              }
              JSONArray jarray = jobj.getJSONArray(SortMembers.SORT_COLUMNS);
              int size = jarray.length();
              for (int ii = 0; ii < size; ++ii) {
                  JSONObject tempObj = jarray.getJSONObject(ii);
                  sortExpressions.add(
                          fromJSONChild(tempObj, SortMembers.SORT_EXPRESSION));
                  if (sortDirections == null ||
                          ! tempObj.has(SortMembers.SORT_DIRECTION)) {
                      continue;
                  }
                  String sdAsString = tempObj.getString(SortMembers.SORT_DIRECTION);
                  sortDirections.add(SortDirectionType.get(sdAsString));
              }
          }
          assert(sortDirections == null || sortExpressions.size() == sortDirections.size());
      }
docs: Load two lists from a JSONObject.
  One list is for sort expressions and the other is for sort directions.
  The lists are cleared before they are filled in.
  This is the inverse of toJSONArrayFromSortList.
  
  The JSONObject should be in object state, not array state.
  It should have a member named SORT_COLUMNS,
  which is an array with the <expression, direction> pairs.
  Sometimes the sort directions are not needed.
  For example, when deserializing
  
  @param sortExpressions The container for the sort expressions.
  @param sortDirections The container for the sort directions.  This may
  be null if we don't care about directions.  If there
  are no directions in the list this will be empty.
  @param jarray
  @throws JSONException