Revision 20100 branches/v10/libraries/libIverUtiles/src/com/iver/utiles/IPersistance.java
IPersistance.java | ||
---|---|---|
44 | 44 |
package com.iver.utiles; |
45 | 45 |
|
46 | 46 |
/** |
47 |
* <p>May be used by objects that want to be serialized with |
|
48 |
* <code>XMLEntity</code>, and to be instantiated after de-serialized.</p> |
|
47 |
* <p>Any object that needs store its data to restore it after, should implement <code>IPersistence</code>.</p> |
|
49 | 48 |
* |
50 |
* <p>For example, write a className and the <code>XMLEntity</code> that represents it.
|
|
51 |
* Then, when you read the file, read the class, instantiate it
|
|
52 |
* and read the <code>XMLEntity</code> after it. Then call <code>setXMLEntity()</code>.
|
|
53 |
* Use it for drivers, symbols and so on.</p>
|
|
49 |
* <p>The process of persisting (for instance in a file) the information of an object using XML is named <i>Marshall</i>,
|
|
50 |
* whereas the inverse process in named <i>Unmarshall</i>.</p>
|
|
51 |
*
|
|
52 |
* <p>It's necessary specify the name of the class that will be persisted or restored.</p>
|
|
54 | 53 |
* |
55 | 54 |
* @author fjp |
56 | 55 |
*/ |
57 | 56 |
public interface IPersistance { |
58 | 57 |
/** |
59 |
* Gets the class name that allows create objects via introspection.
|
|
58 |
* <p>Gets the class name of the object.</p>
|
|
60 | 59 |
* |
61 |
* @return the name of the class that persists
|
|
60 |
* @return the class name of the object
|
|
62 | 61 |
*/ |
63 | 62 |
String getClassName(); |
64 | 63 |
|
65 | 64 |
/** |
66 |
* <p>Returns an XML entity with all needed information about the class to de-serialize |
|
67 |
* and create instances of it.</p> |
|
65 |
* <p>Returns an XML entity with all necessary information of the object to <i>marshall</i>.</p> |
|
68 | 66 |
* |
69 |
* @return the XML entity of the class that persists
|
|
67 |
* @return the XML entity with all necessary information of the object
|
|
70 | 68 |
*/ |
71 | 69 |
XMLEntity getXMLEntity(); |
72 | 70 |
|
73 | 71 |
/** |
74 |
* <p>Sets an XML entity with all needed information about the class to de-serialize |
|
75 |
* and create instances of it.</p> |
|
72 |
* <p>Sets an XML entity with all necessary information of the object.</p> |
|
76 | 73 |
* |
77 |
* @param xml the XML entity of the class that persists
|
|
74 |
* @param xml the XML entity with all necessary information of the object
|
|
78 | 75 |
*/ |
79 | 76 |
void setXMLEntity(XMLEntity xml); |
80 | 77 |
} |
Also available in: Unified diff