01: // Serializer.java
02: // $Id: Serializer.java,v 1.5 2001/01/31 12:59:58 ylafon Exp $
03: // (c) COPYRIGHT MIT, INRIA and Keio, 1999.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05: package org.w3c.tools.resources.serialization;
06:
07: import java.io.Reader;
08: import java.io.Writer;
09: import java.io.IOException;
10:
11: import org.w3c.util.LookupTable;
12: import org.w3c.tools.resources.Resource;
13: import org.w3c.tools.resources.AttributeHolder;
14:
15: /**
16: * @version $Revision: 1.5 $
17: * @author Benoît Mahé (bmahe@w3.org)
18: */
19: public interface Serializer {
20:
21: /**
22: * Write the resource descriptions using the given writer.
23: * @param descr the resource descriptions array
24: * @param writer the writer
25: */
26: public void writeResourceDescriptions(ResourceDescription descr[],
27: Writer writer) throws IOException, SerializationException;
28:
29: /**
30: * Write the resource descriptions using the given writer.
31: * @param descr the resource descriptions array
32: * @param writer the writer
33: */
34: public void writeResourceDescriptions(Resource descr[],
35: Writer writer) throws IOException, SerializationException;
36:
37: /**
38: * Write the resources using the given writer.
39: * @param descr the resource array
40: * @param writer the writer
41: */
42: public void writeResources(AttributeHolder holders[], Writer writer)
43: throws IOException, SerializationException;
44:
45: /**
46: * Read the resource descriptions using the given reader.
47: * @param writer the reader
48: * @return a ResourceDescription array
49: */
50: public ResourceDescription[] readResourceDescriptions(Reader reader)
51: throws IOException, SerializationException;
52:
53: /**
54: * Read the resources using the given reader.
55: * @param writer the reader
56: * @return a Resources array
57: */
58: public Resource[] readResources(Reader reader) throws IOException,
59: SerializationException;
60:
61: /**
62: * Read the attribute holders using the given reader.
63: * @param writer the reader
64: * @return a Resources array
65: */
66: public AttributeHolder[] readAttributeHolders(Reader reader)
67: throws IOException, SerializationException;
68:
69: /**
70: * Load only some attributes
71: * @param attributes the attribute names array.
72: */
73: public LookupTable[] readAttributes(Reader reader,
74: String attributes[]) throws IOException,
75: SerializationException;
76: }
|