Revision 32880 branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dbf/DBFNewStoreParameters.java
DBFNewStoreParameters.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
31 | 31 |
import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters; |
32 |
import org.gvsig.tools.ToolsLocator; |
|
33 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
|
34 |
import org.gvsig.tools.dynobject.DynClass; |
|
35 |
import org.gvsig.tools.dynobject.DynObjectManager; |
|
36 | 32 |
|
37 | 33 |
public class DBFNewStoreParameters extends DBFStoreParameters implements |
38 | 34 |
NewFeatureStoreParameters { |
39 | 35 |
|
40 |
public static final String DYNCLASS_NAME = "DBFNewStoreParameters";
|
|
36 |
public static final String PARAMETERS_DEFINITION_NAME = "DBFNewStoreParameters";
|
|
41 | 37 |
|
42 |
private static final String FIELD_DBFFILENAME = "dbffilename"; |
|
38 |
public static final String FEATURETYPE_PARAMTER_NAME = "FeatureType"; |
|
39 |
|
|
40 |
public static final String CODEPAGE_PARAMTER_NAME = "codePage"; |
|
41 |
|
|
42 |
public DBFNewStoreParameters() { |
|
43 |
super(PARAMETERS_DEFINITION_NAME); |
|
44 |
} |
|
43 | 45 |
|
44 |
protected static DynClass DYNCLASS = null; |
|
45 |
|
|
46 |
private FeatureType defaultFeatureType; |
|
47 |
|
|
48 |
private DelegatedDynObject delegatedDynObject; |
|
49 |
|
|
50 |
protected static void registerDynClass() { |
|
51 |
DynObjectManager dynman = ToolsLocator.getDynObjectManager(); |
|
52 |
DynClass dynClass; |
|
53 |
if (DYNCLASS == null) { |
|
54 |
|
|
55 |
dynClass = dynman.add(DYNCLASS_NAME, |
|
56 |
"new DBF File Store parameters"); |
|
57 |
DBFLibrary.addCodePageField(dynClass); |
|
58 |
dynClass.extend(DBFStoreParameters.DYNCLASS); |
|
59 |
DYNCLASS = dynClass; |
|
60 |
} |
|
61 |
|
|
62 |
} |
|
63 |
|
|
64 | 46 |
public byte getCodePage(){ |
65 |
return ((Byte) this.getDynValue(DBFLibrary.DYNFIELD_CODEPAGE_NAME)) |
|
66 |
.byteValue(); |
|
47 |
return ((Byte) this.getDynValue(CODEPAGE_PARAMTER_NAME)).byteValue(); |
|
67 | 48 |
} |
68 | 49 |
|
69 | 50 |
public void setCodePage(byte value){ |
70 |
// TODO check value |
|
71 |
setDynValue(DBFLibrary.DYNFIELD_CODEPAGE_NAME, new Byte(value)); |
|
51 |
setDynValue(CODEPAGE_PARAMTER_NAME, new Byte(value)); |
|
72 | 52 |
} |
73 | 53 |
|
74 | 54 |
public FeatureType getDefaultFeatureType() { |
75 |
return this.defaultFeatureType;
|
|
55 |
return (FeatureType) this.getDynValue(FEATURETYPE_PARAMTER_NAME);
|
|
76 | 56 |
} |
77 | 57 |
|
78 |
public void setDefaultFeatureType(FeatureType defaultFeatureType) {
|
|
79 |
this.defaultFeatureType = defaultFeatureType;
|
|
58 |
public void setDefaultFeatureType(FeatureType featureType) {
|
|
59 |
this.setDynValue(FEATURETYPE_PARAMTER_NAME, featureType);
|
|
80 | 60 |
} |
81 | 61 |
|
82 |
protected void initialize() { |
|
83 |
this.delegatedDynObject = (DelegatedDynObject) ToolsLocator |
|
84 |
.getDynObjectManager().createDynObject( |
|
85 |
DBFNewStoreParameters.DYNCLASS); |
|
86 |
} |
|
87 |
|
|
88 |
protected DelegatedDynObject getDelegatedDynObject() { |
|
89 |
return delegatedDynObject; |
|
90 |
} |
|
91 | 62 |
} |
Also available in: Unified diff