1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package de.fu_berlin.ties.io;
23
24 /***
25 * Classes implementing this interface support serialization in a
26 * human-readable format, by storing all relevant fields in a
27 * {@link de.fu_berlin.ties.io.FieldMap}.
28 *
29 * <p>Non-abstract implementations of this interface must support
30 * deserialization by providing a public constructor that accepts a
31 * {@link de.fu_berlin.ties.io.FieldMap} as single parameter that reads all
32 * relevant field values from the map. There is no way to enforce this
33 * convention (as interfaces cannot contain constructors), but
34 * deserialization via {@link de.fu_berlin.ties.io.FieldMap#createObject(Class)}
35 * will fail when it is violated. Deserialization is based on a constructor
36 * instead of a "restore" or "init" method to allow the deserialization of
37 * immutable objects (whose fields cannot be changed after construction).
38 *
39 * @author Christian Siefkes
40 * @version $Revision: 1.1 $, $Date: 2004/02/02 18:49:56 $, $Author: siefkes $
41 */
42 public interface Storable {
43
44 /***
45 * Stores all relevant fields of this object in a field map for
46 * serialization. An equivalent object can be created by calling
47 * {@link de.fu_berlin.ties.io.FieldMap#createObject(Class)} on the created
48 * field map.
49 *
50 * @return the created field map
51 */
52 FieldMap storeFields();
53
54 }