Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_daldb / src / org / gvsig / fmap / data / feature / db / jdbc / JDBCExplorerParameter.java @ 24491

History | View | Annotate | Download (1.35 KB)

1
package org.gvsig.fmap.data.feature.db.jdbc;
2

    
3
import java.util.Map;
4

    
5
import org.gvsig.fmap.dal.exceptions.InitializeException;
6
import org.gvsig.fmap.data.feature.db.DBExplorerParameters;
7

    
8
import com.iver.utiles.NotExistInXMLEntity;
9
import com.iver.utiles.XMLEntity;
10

    
11
public abstract class JDBCExplorerParameter extends DBExplorerParameters {
12

    
13
        public abstract String getUrl();
14

    
15
        protected Map createDefaultValuesMap() {
16
                Map defaultValues = super.createDefaultValuesMap();
17
                defaultValues.put("showInformationDBTables", Boolean.FALSE);
18
                return defaultValues;
19
        }
20

    
21
        public boolean isShowInformationDBTables() {
22
                return ((Boolean) this.getAttribute("showInformationDBTables")).booleanValue();
23
        }
24

    
25
        public void setShowInformationDBTables(boolean showInformationDBTables) {
26
                this.put("showInformationDBTables",
27
                                new Boolean(showInformationDBTables));
28
        }
29

    
30
        public XMLEntity getXMLEntity() {
31
                XMLEntity entity = super.getXMLEntity();
32
                entity.putProperty("showInformationDBTables",
33
                                this
34
                                .isShowInformationDBTables());
35
                return entity;
36

    
37
        }
38

    
39
        public void loadFromXMLEntity(XMLEntity xmlEntity)
40
                        throws InitializeException {
41
                super.loadFromXMLEntity(xmlEntity);
42
                try {
43
                        this.setShowInformationDBTables(xmlEntity
44
                                        .getBooleanProperty("showInformationDBTables"));
45
                } catch (NotExistInXMLEntity e) {
46
                        // Default value
47
                        this.remove("showInformationDBTables");
48
                }
49
        }
50

    
51
}