01: package com.completex.objective.components.persistency.io.sdl;
02:
03: import com.completex.objective.components.persistency.Query;
04: import com.completex.objective.components.persistency.Call;
05: import com.completex.objective.components.persistency.BasicQuery;
06:
07: import java.io.IOException;
08: import java.io.Writer;
09: import java.io.Reader;
10:
11: /**
12: * @author Gennady Krizhevsky
13: */
14: public interface QuerySdlConverter {
15: /**
16: * Converts query to SDL string
17: *
18: * @param query query object
19: * @return SDL string representing query
20: */
21: String toSdl(Query query);
22:
23: /**
24: * Converts call to SDL string
25: *
26: * @param call Call object
27: * @return SDL string representing call
28: */
29: String toSdl(Call call);
30:
31: /**
32: * Converts SDL string to corresponding query/call
33: *
34: * @param sdl Call object
35: * @return query/call object
36: * @throws IOException if SDL is incorrect
37: * @throws com.completex.objective.components.persistency.OdalRuntimePersistencyException if any other problems are found
38: */
39: BasicQuery fromSdl(String sdl) throws IOException;
40:
41: /**
42: * Writes SDL string representing query to a specified Writer
43: *
44: * @see Writer
45: * @param query query object
46: * @param writer writer
47: * @throws IOException If an I/O error occurs
48: */
49: void toSdl(Query query, Writer writer) throws IOException;
50:
51: /**
52: * Writes SDL string representing call to a specified Writer
53: *
54: * @see Writer
55: * @param call call object
56: * @param writer writer
57: * @throws IOException If an I/O error occurs
58: */
59: void toSdl(Call call, Writer writer) throws IOException;
60:
61: /**
62: * Converts SDL string to corresponding query/call from a specified Reader
63: *
64: * @param reader Reader
65: * @return query/call object
66: * @throws IOException If an I/O error occurs
67: */
68: BasicQuery fromSdl(Reader reader) throws IOException;
69: }
|