Revision 23602 branches/v2_0_0_prep/libraries/libFMap_dataFile/src/org/gvsig/fmap/data/feature/file/dbf/DBFStoreParameters.java
DBFStoreParameters.java | ||
---|---|---|
4 | 4 |
import java.util.Map; |
5 | 5 |
|
6 | 6 |
import org.gvsig.fmap.data.InitializeException; |
7 |
import org.gvsig.fmap.data.feature.file.AbstractFileStoreParameters; |
|
8 | 7 |
import org.gvsig.fmap.data.feature.file.FileStoreParameters; |
9 | 8 |
|
10 | 9 |
import com.iver.utiles.NotExistInXMLEntity; |
11 | 10 |
import com.iver.utiles.XMLEntity; |
12 | 11 |
|
13 |
public class DBFStoreParameters extends AbstractFileStoreParameters implements |
|
14 |
FileStoreParameters { |
|
12 |
public class DBFStoreParameters extends FileStoreParameters { |
|
15 | 13 |
|
16 |
private File dbffile; |
|
17 | 14 |
|
15 |
protected Map createDefaultValuesMap() { |
|
16 |
Map defaultValues = super.createDefaultValuesMap(); |
|
17 |
defaultValues.put("dbffile", null); |
|
18 |
return defaultValues; |
|
19 |
} |
|
18 | 20 |
public String getDataStoreName() { |
19 | 21 |
return DBFStore.DATASTORE_NAME; |
20 | 22 |
} |
21 | 23 |
|
22 | 24 |
public boolean isValid() { |
23 |
return (dbffile != null);
|
|
25 |
return (this.getDBFFile() != null);
|
|
24 | 26 |
} |
25 | 27 |
|
26 | 28 |
/* |
... | ... | |
44 | 46 |
} |
45 | 47 |
|
46 | 48 |
protected File getDBFFile() { |
47 |
return dbffile;
|
|
49 |
return (File) this.get("dbffile");
|
|
48 | 50 |
} |
49 | 51 |
|
50 | 52 |
protected void setDBFFile(File aFile) { |
51 | 53 |
super.setFile(aFile); |
52 |
this.dbffile = aFile;
|
|
54 |
this.put("dbffile", aFile);
|
|
53 | 55 |
} |
54 | 56 |
|
55 | 57 |
public boolean fileAccept(File f) { |
... | ... | |
62 | 64 |
|
63 | 65 |
public XMLEntity getXMLEntity() { |
64 | 66 |
XMLEntity xmlEntity = super.getXMLEntity(); |
65 |
xmlEntity.putProperty("dbffile", this.dbffile.getPath());
|
|
67 |
xmlEntity.putProperty("dbffile", this.getDBFFile().getPath());
|
|
66 | 68 |
return xmlEntity; |
67 | 69 |
} |
68 | 70 |
|
... | ... | |
70 | 72 |
throws InitializeException { |
71 | 73 |
super.loadFromXMLEntity(xmlEntity); |
72 | 74 |
try{ |
73 |
this.dbffile = new File(xmlEntity.getStringProperty("dbffile"));
|
|
75 |
this.setDBFFile(new File(xmlEntity.getStringProperty("dbffile")));
|
|
74 | 76 |
} catch (NotExistInXMLEntity e) { |
75 | 77 |
throw new InitializeException("dbffile property not found", this |
76 | 78 |
.getDataStoreName()); |
77 | 79 |
} |
78 | 80 |
} |
79 | 81 |
|
80 |
protected Map getInternalMap() { |
|
81 |
Map map = super.getInternalMap(); |
|
82 |
map.put("dbffile", this.dbffile); |
|
83 |
return map; |
|
84 |
} |
|
85 | 82 |
} |
Also available in: Unified diff