Revision 47789 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.lib/src/main/java/org/gvsig/fmap/dal/store/simplereader/SimpleReaderStoreParameters.java
SimpleReaderStoreParameters.java | ||
---|---|---|
68 | 68 |
|
69 | 69 |
protected DelegatedDynObject parameters; |
70 | 70 |
protected FeatureType featureType; |
71 |
protected boolean defaultValueOfAutomaticTypesDetection = true;
|
|
71 |
protected boolean all_fields_declare_type = false;
|
|
72 | 72 |
|
73 | 73 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
74 | 74 |
public SimpleReaderStoreParameters(String parametersDefinitionName, String name) { |
... | ... | |
93 | 93 |
} |
94 | 94 |
|
95 | 95 |
@Override |
96 |
public Object getDynValue(String name) { |
|
97 |
if(StringUtils.equalsIgnoreCase(name, AUTOMATICTYPESDETECTION)){ |
|
98 |
//Si tenemos featureType y estan declarados todos los tipos, ya no es necesario hacer la deteccion automatica |
|
99 |
if(this.featureType != null){ |
|
100 |
if( this.all_fields_declare_type ){ |
|
101 |
return false; |
|
102 |
} |
|
103 |
} |
|
104 |
} |
|
105 |
return super.getDynValue(name); |
|
106 |
} |
|
107 |
|
|
108 |
@Override |
|
96 | 109 |
public boolean isValid() { |
97 | 110 |
return getFileName(this) != null; |
98 | 111 |
} |
... | ... | |
310 | 323 |
IProjection proj = null; |
311 | 324 |
FeatureType ftype = this.getFeatureType(); |
312 | 325 |
if( ftype!=null ) { |
313 |
this.setDynValue(AUTOMATICTYPESDETECTION, defaultValueOfAutomaticTypesDetection); |
|
314 | 326 |
proj = ftype.getDefaultSRS(); |
315 | 327 |
if( proj!=null ) { |
316 | 328 |
this.setDynValue(CRS_PARAMTER_NAME, proj); |
... | ... | |
351 | 363 |
if( featureTypeLoader!=null ) { |
352 | 364 |
EditableFeatureType ftype = DALLocator.getDataManager().createFeatureType(); |
353 | 365 |
featureTypeLoader.loadFeatureType(ftype, false, null); |
354 |
boolean all_fields_declare_type = featureTypeLoader.isAllFieldsDeclareType(); |
|
355 |
defaultValueOfAutomaticTypesDetection = !all_fields_declare_type; |
|
366 |
this.all_fields_declare_type = featureTypeLoader.isAllFieldsDeclareType(); |
|
356 | 367 |
this.featureType = ftype; |
357 | 368 |
} |
358 | 369 |
} catch (Exception ex) { |
... | ... | |
362 | 373 |
} |
363 | 374 |
return this.featureType; |
364 | 375 |
} |
365 |
|
|
376 |
|
|
366 | 377 |
@Override |
367 | 378 |
public String getSourceId() { |
368 | 379 |
return this.toString(); // FIXME: Check if is correnct |
Also available in: Unified diff