Revision 47636 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.csv/src/main/java/org/gvsig/fmap/dal/store/csv/CSVStoreParameters.java
CSVStoreParameters.java | ||
---|---|---|
33 | 33 |
import org.gvsig.basicformats.FormatsFile; |
34 | 34 |
import org.gvsig.basicformats.PRJFile; |
35 | 35 |
import org.gvsig.fmap.dal.DALLocator; |
36 |
import org.gvsig.fmap.dal.FileHelper; |
|
37 | 36 |
import org.gvsig.fmap.dal.exception.ValidateDataParametersException; |
38 | 37 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
39 | 38 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
40 | 39 |
import org.gvsig.fmap.dal.feature.FeatureType; |
41 | 40 |
import org.gvsig.fmap.dal.feature.OpenFeatureStoreParameters; |
42 | 41 |
import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters; |
43 |
import org.gvsig.fmap.dal.spi.AbstractDataStoreParameters; |
|
44 |
import org.gvsig.fmap.dal.spi.DataStoreProviderServices; |
|
42 |
import org.gvsig.fmap.dal.store.simplereader.SimpleReaderStoreParameters; |
|
45 | 43 |
import org.gvsig.fmap.geom.Geometry; |
46 | 44 |
import org.gvsig.tools.dynobject.DelegatedDynObject; |
47 | 45 |
import org.gvsig.tools.dynobject.DynObject; |
... | ... | |
54 | 52 |
import org.supercsv.quote.QuoteMode; |
55 | 53 |
|
56 | 54 |
@SuppressWarnings("UseSpecificCatch") |
57 |
public class CSVStoreParameters extends AbstractDataStoreParameters implements
|
|
55 |
public class CSVStoreParameters extends SimpleReaderStoreParameters implements
|
|
58 | 56 |
OpenFeatureStoreParameters, FilesystemStoreParameters { |
59 | 57 |
|
60 | 58 |
private static final Logger LOGGER = LoggerFactory.getLogger(CSVStoreParameters.class); |
... | ... | |
83 | 81 |
private static final String CHARSET = "charset"; // Default "UTF-8" |
84 | 82 |
private static final String LOCALE = "locale"; |
85 | 83 |
private static final String POINT_COLUMN_NAME = "pointColumnName"; |
86 |
private static final String LIMIT = "limit"; |
|
84 |
// private static final String LIMIT = "limit";
|
|
87 | 85 |
private static final String INCLUDE_METADATA_IN_HEADER = "includeMetadataInHeader"; |
88 | 86 |
private static final String GEOMETRY_COLUMN = "geometry_column"; |
89 | 87 |
private static final String GEOMETRY_TYPE = "GeometryType"; |
... | ... | |
99 | 97 |
} |
100 | 98 |
|
101 | 99 |
protected CSVStoreParameters(String parametersDefinitionName) { |
102 |
this(parametersDefinitionName, CSVStoreProvider.NAME);
|
|
100 |
super(parametersDefinitionName, CSVStoreProvider.NAME);
|
|
103 | 101 |
} |
104 | 102 |
|
105 |
@SuppressWarnings("OverridableMethodCallInConstructor") |
|
106 |
public CSVStoreParameters(String parametersDefinitionName, String name) { |
|
107 |
super(); |
|
108 |
this.parameters = (DelegatedDynObject) FileHelper.newParameters(parametersDefinitionName); |
|
109 |
this.setDynValue(DataStoreProviderServices.PROVIDER_PARAMTER_NAME, name); |
|
110 |
} |
|
111 |
|
|
112 | 103 |
private FeatureType getFeatureType() { |
113 | 104 |
if( this.featureType==null ) { |
114 | 105 |
try { |
... | ... | |
499 | 490 |
return s.trim(); |
500 | 491 |
} |
501 | 492 |
|
502 |
public static int getSkipLines(DynObject dynobj) { |
|
503 |
Integer n = (Integer) dynobj.getDynValue("skipLines"); |
|
504 |
if ( n == null ) { |
|
505 |
return 0; |
|
506 |
} |
|
507 |
return n; |
|
508 |
} |
|
509 |
|
|
510 |
public static int getLimit(DynObject dynobj) { |
|
511 |
Integer n = (Integer) dynobj.getDynValue(LIMIT); |
|
512 |
if ( n == null ) { |
|
513 |
return -1; |
|
514 |
} |
|
515 |
return n; |
|
516 |
} |
|
517 |
|
|
493 |
// public static int getSkipLines(DynObject dynobj) {
|
|
494 |
// Integer n = (Integer) dynobj.getDynValue("skipLines");
|
|
495 |
// if ( n == null ) {
|
|
496 |
// return 0;
|
|
497 |
// }
|
|
498 |
// return n;
|
|
499 |
// }
|
|
500 |
// |
|
501 |
// public static int getLimit(DynObject dynobj) {
|
|
502 |
// Integer n = (Integer) dynobj.getDynValue(LIMIT);
|
|
503 |
// if ( n == null ) {
|
|
504 |
// return -1;
|
|
505 |
// }
|
|
506 |
// return n;
|
|
507 |
// }
|
|
508 |
// |
|
518 | 509 |
public static String getRawFieldsDefinition(DynObject dynobj) { |
519 | 510 |
String s = (String) dynobj.getDynValue("fieldsDefinition"); |
520 | 511 |
if ( StringUtils.isBlank(s) ) { |
Also available in: Unified diff