svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.spi / src / main / java / org / gvsig / fmap / dal / feature / spi / AbstractFeatureStoreProviderFactory.java @ 40435
History | View | Annotate | Download (1.64 KB)
1 | 40435 | jjdelcerro | package org.gvsig.fmap.dal.feature.spi; |
---|---|---|---|
2 | |||
3 | import java.util.List; |
||
4 | |||
5 | import org.gvsig.fmap.dal.DALLocator; |
||
6 | import org.gvsig.fmap.dal.DataManager; |
||
7 | import org.gvsig.fmap.dal.DataStoreProviderFactory; |
||
8 | import org.gvsig.fmap.dal.DataTypes; |
||
9 | import org.gvsig.fmap.dal.feature.EditableFeatureType; |
||
10 | import org.gvsig.fmap.dal.feature.FeatureStoreProviderFactory; |
||
11 | import org.gvsig.fmap.dal.feature.FeatureType; |
||
12 | import org.gvsig.fmap.dal.spi.AbstractDataStoreProviderFactory; |
||
13 | |||
14 | public abstract class AbstractFeatureStoreProviderFactory extends |
||
15 | AbstractDataStoreProviderFactory implements FeatureStoreProviderFactory {
|
||
16 | |||
17 | |||
18 | public AbstractFeatureStoreProviderFactory(String name, String description) { |
||
19 | super(name, description);
|
||
20 | } |
||
21 | |||
22 | public int allowMultipleGeometryTypes() { |
||
23 | return UNKNOWN;
|
||
24 | } |
||
25 | |||
26 | public int allowEditableFeatureType() { |
||
27 | return UNKNOWN;
|
||
28 | } |
||
29 | |||
30 | public List getSupportedDataTypes() { |
||
31 | // null means all supported
|
||
32 | return null; |
||
33 | } |
||
34 | |||
35 | public List getSupportedGeometryTypesSubtypes() { |
||
36 | // null means all supported
|
||
37 | return null; |
||
38 | } |
||
39 | |||
40 | public boolean allowsMandatoryAttributes() { |
||
41 | return true; |
||
42 | } |
||
43 | |||
44 | public boolean allowsPrimaryKeyAttributes() { |
||
45 | return true; |
||
46 | } |
||
47 | |||
48 | /**
|
||
49 | * @return dummy feature type. Must be overridden by subclasses
|
||
50 | *
|
||
51 | */
|
||
52 | public FeatureType createDefaultFeatureType() {
|
||
53 | DataManager dm = DALLocator.getDataManager(); |
||
54 | EditableFeatureType eft = dm.createFeatureType(); |
||
55 | |||
56 | if (allowEditableFeatureType() == DataStoreProviderFactory.YES) {
|
||
57 | return eft;
|
||
58 | } else {
|
||
59 | return eft.getNotEditableCopy();
|
||
60 | } |
||
61 | } |
||
62 | |||
63 | } |