Revision 23540 branches/v2_0_0_prep/libraries/libFMap_dataDB/src/org/gvsig/fmap/data/feature/db/jdbc/JDBCExplorerParameter.java

View differences:

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

  
3
import java.util.Map;
4

  
3 5
import org.gvsig.fmap.data.InitializeException;
4 6
import org.gvsig.fmap.data.feature.db.DBExplorerParameters;
5 7

  
......
9 11
public abstract class JDBCExplorerParameter extends DBExplorerParameters {
10 12
	protected boolean showInformationDBTables = false;
11 13

  
14
	public void clear() {
15
		super.clear();
16
		this.showInformationDBTables = false;
17
	}
18

  
12 19
	public abstract String getUrl();
13 20

  
14 21
	public boolean isShowInformationDBTables() {
......
17 24

  
18 25
	public void setShowInformationDBTables(boolean showInformationDBTables) {
19 26
		this.showInformationDBTables = showInformationDBTables;
27
		this.clearInternalMap();
20 28
	}
21 29

  
22 30
	public XMLEntity getXMLEntity() {
......
29 37

  
30 38
	public void loadFromXMLEntity(XMLEntity xmlEntity)
31 39
			throws InitializeException {
32
		// TODO Auto-generated method stub
33 40
		super.loadFromXMLEntity(xmlEntity);
34 41
		try {
35 42
			this.showInformationDBTables = xmlEntity
......
40 47
		}
41 48
	}
42 49

  
50
	public Object put(Object key, Object value) {
51
		if (!(key instanceof String)) {
52
			throw new ClassCastException("key must be String");
43 53

  
54
		}
55
		String sKey = (String) key;
56
		Object rValue = null;
57

  
58
		if (sKey.equalsIgnoreCase("showInformationDBTables")) {
59
			rValue = new Boolean(this.showInformationDBTables);
60
			this.showInformationDBTables = ((Boolean) value).booleanValue();
61
			this.clearInternalMap();
62
			return rValue;
63
		}
64
		return super.put(sKey, value);
65
	}
66

  
67
	protected Map getInternalMap() {
68
		Map internal = super.getInternalMap();
69
		internal.put("showInformationDBTables", new Boolean(
70
				this.showInformationDBTables));
71
		return internal;
72
	}
73

  
44 74
}

Also available in: Unified diff