svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.utils / src / main / java / org / gvsig / utils / IPersistence.java @ 40561
History | View | Annotate | Download (2.01 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.utils; |
25 |
|
26 |
/**
|
27 |
* <p>Any object that needs store its data to restore it after, should implement <code>IPersistence</code>.</p>
|
28 |
*
|
29 |
* <p>The process of persisting (for instance in a file) the information of an object using XML is named <i>Marshall</i>,
|
30 |
* whereas the inverse process in named <i>Unmarshall</i>.</p>
|
31 |
*
|
32 |
* <p>It's necessary specify the name of the class that will be persisted or restored.</p>
|
33 |
*
|
34 |
* @author fjp
|
35 |
*/
|
36 |
public interface IPersistence { |
37 |
/**
|
38 |
* <p>Gets the class name of the object.</p>
|
39 |
*
|
40 |
* @return the class name of the object
|
41 |
*/
|
42 |
String getClassName();
|
43 |
|
44 |
/**
|
45 |
* <p>Returns an XML entity with all necessary information of the object to <i>marshall</i>.</p>
|
46 |
*
|
47 |
* @return the XML entity with all necessary information of the object
|
48 |
*/
|
49 |
XMLEntity getXMLEntity() throws XMLException;
|
50 |
|
51 |
/**
|
52 |
* <p>Sets an XML entity with all necessary information of the object.</p>
|
53 |
*
|
54 |
* @param xml the XML entity with all necessary information of the object
|
55 |
*/
|
56 |
void setXMLEntity(XMLEntity xml) throws XMLException; |
57 |
} |