public static void parseTuple(InputStream in,QueryResultFormat format,TupleQueryResultHandler handler,ValueFactory valueFactory) throws IOException, QueryResultParseException, TupleQueryResultHandlerException, UnsupportedQueryResultFormatException {
  TupleQueryResultParser parser=createTupleParser(format);
  parser.setValueFactory(valueFactory);
  parser.setQueryResultHandler(handler);
  try {
    parser.parseQueryResult(in);
  }
 catch (  QueryResultHandlerException e) {
    if (e instanceof TupleQueryResultHandlerException) {
      throw (TupleQueryResultHandlerException)e;
    }
 else {
      throw new TupleQueryResultHandlerException(e);
    }
  }
}

public static void parseTuple ( InputStream in , QueryResultFormat format , TupleQueryResultHandler handler , ValueFactory valueFactory ) throws IOException , QueryResultParseException , TupleQueryResultHandlerException , UnsupportedQueryResultFormatException { TupleQueryResultParser parser = createTupleParser ( format ) ; parser . setValueFactory ( valueFactory ) ; parser . setQueryResultHandler ( handler ) ; try { parser . parseQueryResult ( in ) ; } catch ( QueryResultHandlerException e ) { if ( e instanceof TupleQueryResultHandlerException ) { throw ( TupleQueryResultHandlerException ) e ; } else { throw new TupleQueryResultHandlerException ( e ) ; } } }
parses a query result document , reporting the parsed solutions to the supplied tuplequeryresulthandler .
