root / branches / v2_0_0_prep / libraries / libIverUtiles / src / org / gvsig / tools / persistence / xmlentity / XMLEntityManager.java @ 24378
History | View | Annotate | Download (806 Bytes)
1 |
package org.gvsig.tools.persistence.xmlentity; |
---|---|
2 |
|
3 |
import org.gvsig.tools.persistence.AbstractPersistenceManager; |
4 |
import org.gvsig.tools.persistence.PersistenceException; |
5 |
import org.gvsig.tools.persistence.Persistent; |
6 |
import org.gvsig.tools.persistence.PersistentState; |
7 |
|
8 |
import com.iver.utiles.XMLEntity; |
9 |
|
10 |
public class XMLEntityManager extends AbstractPersistenceManager { |
11 |
|
12 |
|
13 |
public PersistentState createState(XMLEntity xmlEntity)
|
14 |
throws PersistenceException {
|
15 |
return new XMLEntityState(this, xmlEntity); |
16 |
} |
17 |
|
18 |
public PersistentState createState(Object obj, boolean initialize) |
19 |
throws PersistenceException {
|
20 |
PersistentState state = new XMLEntityState(this); |
21 |
state.setTheClass(obj); |
22 |
if (initialize && obj instanceof Persistent) { |
23 |
((Persistent) obj).loadState(state); |
24 |
} |
25 |
return state;
|
26 |
} |
27 |
|
28 |
} |