...
SINCE FEWS 2011.01
Ideally a parser does not need any additional information and is dedicated to parse one strict specified file format.
In some cases the parser needs additional configuration. Don't use a separate additional configuration file in this case because this file can not be managed by FEWS.
You can configure additional properties in the time series import module. By implementing the PropertiesConsumer interface the properties are injected in your parser.
Code Block | ||||
---|---|---|---|---|
| ||||
<import>
<general>
<importType>PI</importType>
<folder>$IMPORT_FOLDER$/meteo/tabel/tk</folder>
<failedFolder>$IMPORT_FAILED_FOLDER$/meteo/tabel/tk</failedFolder>
<backupFolder>$IMPORT_BACKUP_FOLDER$/meteo/tabel/tk</backupFolder>
<idMapId>IdImportMeteo_1d</idMapId>
<unitConversionsId>ImportUnitConversions</unitConversionsId>
<dataFeedId>Neerslag_24uur</dataFeedId>
</general>
<properties>
<string key="decimalSeparator" value="."/>
/properties>
<timeSeriesSet>
|
Code Block |
---|
public class CsvTimeSeriesParser implements TextParser<TimeSeriesContentHandler>, PropertiesConsumer {
@Override
public void setProperties(Properties properties) {
decimalSeparator = properties.getString("decimalSeparator", ".");
}
|
Examples
TextParsers
LocationIdsHeaderCsvParser.java
...