1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package com.ontotext.wsmo4j.serializer.wsml;
20
21
22
23
24
25
26
27
28
29
30
31 import java.io.IOException;
32 import java.io.StringWriter;
33 import java.io.Writer;
34 import java.util.Map;
35
36 import org.wsmo.common.TopEntity;
37 import org.wsmo.wsml.Serializer;
38
39 public class WSMLSerializerImpl implements Serializer {
40
41 public WSMLSerializerImpl(Map <String, Object> props) {
42
43 }
44
45 public void serialize(TopEntity[] item, StringBuffer writer) {
46 StringWriter wrt = new StringWriter();
47 try {
48 serialize(item, wrt);
49 writer.append(wrt.getBuffer());
50 }
51 catch (IOException ioe) {
52 throw new RuntimeException("cannot write due to an exception:", ioe);
53 }
54 }
55
56 public void serialize(TopEntity[] item, StringBuffer writer, Map options) {
57 throw new UnsupportedOperationException("Unimplemented method serialize(TopEntity, StringBuffer, Map)");
58 }
59
60
61 public void serialize(TopEntity[] topItem, Writer writer) throws IOException {
62
63 new WSMLTextExportHelper(writer).process(topItem);
64 }
65
66 public void serialize(TopEntity[] item, Writer writer, Map options) {
67 throw new UnsupportedOperationException("Unimplemented method serialize(TopEntity, Writer, Map)");
68 }
69
70
71 }