1 /*
2 wsmo4j - a WSMO API and Reference Implementation
3
4 Copyright (c) 2004-2005, OntoText Lab. / SIRMA
5
6 This library is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the Free
8 Software Foundation; either version 2.1 of the License, or (at your option)
9 any later version.
10 This library is distributed in the hope that it will be useful, but WITHOUT
11 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 details.
14 You should have received a copy of the GNU Lesser General Public License along
15 with this library; if not, write to the Free Software Foundation, Inc.,
16 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 /**
20 * <p>Title: WSMO4J</p>
21 * <p>Description: WSMO API and a Reference Implementation</p>
22 * <p>Copyright: Copyright (c) 2004-2005</p>
23 * <p>Company: OntoText Lab. / SIRMA </p>
24 */
25
26 package org.wsmo.wsml;
27
28
29 import java.io.*;
30 import java.util.*;
31
32 import org.wsmo.common.*;
33
34 /**
35 *
36 * @author not attributable
37 * @version $Revision: 581 $ $Date: 2005-07-22 15:29:53 +0300 (Fri, 22 Jul 2005) $
38 */
39 public interface Serializer {
40 /**
41 * serializes Ontology, Goal, Mediator or a Webservice
42 * @param item A top level WSMO item to serialize
43 * Note that since the parser expects an open stream it will <b>not</b>
44 * attempt to close the stream after writing to it. E.g. it is the responsibility of the user
45 * to open/close the stream.
46 * @param target The writer to write to
47 * @throws java.io.IOException
48 */
49 void serialize(TopEntity[] item, Writer target)
50 throws IOException;
51
52 /**
53 * serializes Ontology, Goal, Mediator or a Webservice
54 * @param item A top level WSMO item to serialize
55 * Note that since the parser expects an open stream it will <b>not</b>
56 * attempt to close the stream after writing to it. E.g. it is the responsibility of the user
57 * to open/close the stream.
58 * @param target The writer to write to
59 * @param options an optional Map with user supplied options specific to this serialisation
60 * @throws java.io.IOException
61 */
62 void serialize(TopEntity[] item, Writer target, Map options)
63 throws IOException;
64
65 /**
66 * serializes Ontology, Goal, Mediator or a Webservice
67 * @param item A top level WSMO item to serialize
68 * in the same string buffer
69 * @param target The buffer to write to
70 */
71 void serialize(TopEntity[] item, StringBuffer target);
72
73 /**
74 * serializes Ontology, Goal, Mediator or a Webservice
75 * @param item A top level WSMO item to serialize
76 * in the same string buffer
77 * @param target The buffer to write to
78 * @param options an optional Map with user supplied options specific to this serialization
79 */
80 void serialize(TopEntity[] item, StringBuffer target, Map options);
81
82 String SERIALIZER_LE_SERIALIZER = "serializer_le_serializer";
83 }
84 /*
85 * $Log$
86 * Revision 1.4 2005/07/22 12:29:33 vassil_momtchev
87 * works with array of entities (again!)
88 *
89 * Revision 1.3 2005/07/01 13:16:08 marin_dimitrov
90 * added an optional Map param
91 *
92 * Revision 1.2 2005/06/30 13:42:44 marin_dimitrov
93 * serialize() now accepts a SINGLE TopEntity (was: array of TEs)
94 *
95 * Revision 1.1 2005/06/30 12:29:16 alex_simov
96 * renamed
97 *
98 * Revision 1.2 2005/06/30 09:52:53 marin_dimitrov
99 * Parser and Serialiser split
100 *
101 */