01: package org.obe.spi.service;
02:
03: import org.obe.client.api.repository.RepositoryException;
04: import org.obe.spi.WorkflowService;
05: import org.w3c.dom.Document;
06: import org.w3c.dom.Element;
07: import org.xml.sax.InputSource;
08: import org.xml.sax.SAXException;
09:
10: import javax.ejb.EJBHome;
11: import javax.ejb.EJBObject;
12: import javax.ejb.Handle;
13: import javax.ejb.HomeHandle;
14: import javax.xml.transform.Source;
15: import javax.xml.transform.Transformer;
16: import java.io.IOException;
17: import java.io.InputStream;
18: import java.rmi.RemoteException;
19: import java.util.Date;
20: import java.util.Map;
21: import java.util.Properties;
22:
23: /**
24: * Converts data between different classes.
25: *
26: * @author Adrian Price
27: */
28: public interface DataConverter extends WorkflowService {
29: String SERVICE_NAME = "DataConverter";
30:
31: Object convertValue(Object src, int xpdlType);
32:
33: Object convertValue(Object src, Class type);
34:
35: Object convertValueEx(Object src, Class type);
36:
37: Object toArray(Object src);
38:
39: Object toArray(Object src, Class type);
40:
41: boolean toBoolean(Object src);
42:
43: byte toByte(Object src);
44:
45: char toChar(Object src);
46:
47: Date toDate(Object src);
48:
49: Document toDocument(Object src);
50:
51: double toDouble(Object src);
52:
53: EJBHome toEJBHome(Object src) throws RemoteException;
54:
55: EJBObject toEJBObject(Object src) throws RemoteException;
56:
57: Element toElement(Object src);
58:
59: float toFloat(Object src);
60:
61: Handle toHandle(Object src) throws RemoteException;
62:
63: HomeHandle toHomeHandle(Object src) throws RemoteException;
64:
65: InputStream toInputStream(Object src) throws IOException;
66:
67: InputSource toInputSource(Object src) throws IOException;
68:
69: int toInt(Object src);
70:
71: long toLong(Object src);
72:
73: Properties toProperties(Object src);
74:
75: short toShort(Object src);
76:
77: Source toSource(Object src) throws IOException, SAXException;
78:
79: String toString(Object src);
80:
81: String toString(Object value, int len);
82:
83: Document transform(Object input, String transformURI, Map parms)
84: throws RepositoryException;
85:
86: Transformer getTransformer(String transformURI)
87: throws RepositoryException;
88: }
|