01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.query.resultio;
07:
08: import java.io.IOException;
09: import java.io.InputStream;
10:
11: import org.openrdf.model.ValueFactory;
12: import org.openrdf.query.TupleQueryResultHandler;
13: import org.openrdf.query.TupleQueryResultHandlerException;
14:
15: /**
16: * A general interface for tuple query result parsers.
17: */
18: public interface TupleQueryResultParser {
19:
20: /**
21: * Gets the query result format that this parser can parse.
22: */
23: public TupleQueryResultFormat getTupleQueryResultFormat();
24:
25: /**
26: * Sets the ValueFactory that the parser will use to create Value objects for
27: * the parsed query result.
28: *
29: * @param valueFactory
30: * The value factory that the parser should use.
31: */
32: public void setValueFactory(ValueFactory valueFactory);
33:
34: /**
35: * Sets the TupleQueryResultHandler that will handle the parsed query result
36: * data.
37: */
38: public void setTupleQueryResultHandler(
39: TupleQueryResultHandler handler);
40:
41: /**
42: * Parses the data from the supplied InputStream.
43: *
44: * @param in
45: * The InputStream from which to read the data.
46: * @throws IOException
47: * If an I/O error occurred while data was read from the InputStream.
48: * @throws QueryResultParseException
49: * If the parser has encountered an unrecoverable parse error.
50: * @throws TupleQueryResultHandlerException
51: * If the configured query result handler has encountered an
52: * unrecoverable error.
53: */
54: public void parse(InputStream in) throws IOException,
55: QueryResultParseException, TupleQueryResultHandlerException;
56: }
|