01: package org.objectweb.celtix.tools.common.toolspec;
02:
03: import java.io.*;
04: import org.w3c.dom.Document;
05: import org.objectweb.celtix.tools.common.ToolException;
06:
07: public interface ToolContext {
08:
09: /**
10: * Request an input stream.
11: * @param id the id of the stream in the streams sections of the tool's definition document.
12: */
13: InputStream getInputStream(String id) throws ToolException;
14:
15: /**
16: * Request the standard input stream.
17: */
18: InputStream getInputStream() throws ToolException;
19:
20: /**
21: * Request a document based on the input stream.
22: * This is only returned if the mime type of incoming stream is xml.
23: */
24: Document getInputDocument(String id) throws ToolException;
25:
26: /**
27: * Request a document based on the standard input stream.
28: * This is only returned if the mime type of incoming stream is xml.
29: */
30: Document getInputDocument() throws ToolException;
31:
32: OutputStream getOutputStream(String id) throws ToolException;
33:
34: OutputStream getOutputStream() throws ToolException;
35:
36: String getParameter(String name) throws ToolException;
37:
38: String[] getParameters(String name) throws ToolException;
39:
40: boolean hasParameter(String name) throws ToolException;
41:
42: void sendDocument(String id, Document doc);
43:
44: void sendDocument(Document doc);
45:
46: void executePipeline();
47:
48: void setUserObject(String key, Object o);
49:
50: Object getUserObject(String key);
51:
52: }
|