|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gisgraphy.importer.AbstractSimpleImporterProcessor
com.gisgraphy.importer.GeonamesAlternateNamesExtracter
public class GeonamesAlternateNamesExtracter
Extract the alternateNames into separate files : one for country, one for adm1 and one for adm2
| Field Summary | |
|---|---|
protected File |
adm1file
|
protected OutputStreamWriter |
adm1fileOutputStreamWriter
|
protected Map<Long,String> |
adm1Map
|
protected File |
adm2file
|
protected OutputStreamWriter |
adm2fileOutputStreamWriter
|
protected Map<Long,String> |
adm2Map
|
protected File |
countryFile
|
protected OutputStreamWriter |
countryfileOutputStreamWriter
|
protected Map<Long,String> |
countryMap
|
protected File |
featuresFile
|
protected OutputStreamWriter |
featuresfileOutputStreamWriter
|
| Fields inherited from class com.gisgraphy.importer.AbstractSimpleImporterProcessor |
|---|
COMMENT_START, currentFile, importerConfig, in, internationalisationService, logger, readFileLine, status, statusMessage, totalReadLine, transactionManager, txDefinition, txStatus |
| Constructor Summary | |
|---|---|
GeonamesAlternateNamesExtracter()
Default Constructor |
|
| Method Summary | |
|---|---|
protected void |
flushAndClear()
Should flush and clear all the Daos that are used by the processor. |
protected File[] |
getFiles()
|
protected int |
getNumberOfColumns()
|
protected void |
initFiles()
|
protected boolean |
lineIsAnAlternateNameForAdm1(Long featureId)
|
protected boolean |
lineIsAnAlternateNameForCountry(Long featureId)
|
protected boolean |
lineIsAnAlternatNameForAdm2(Long featureId)
|
protected Map<Long,String> |
populateMapFromList(List<Long> list)
|
protected void |
processData(String line)
Process a read line of the geonames file, must be implemented by the concrete class |
List<NameValueDTO<Integer>> |
rollback()
/! |
void |
setAdmDao(IAdmDao admDao)
|
protected void |
setCommitFlushMode()
Will flush after every commit |
void |
setCountryDao(ICountryDao countryDao)
|
void |
setup()
Template method that can be override. |
boolean |
shouldBeSkipped()
|
protected boolean |
shouldIgnoreComments()
Whether the filter should ignore the comments (i.e. lines starting with #) |
protected boolean |
shouldIgnoreFirstLine()
Template Method : Whether the processor should ignore the first line of the input |
protected void |
tearDown()
Template method that can be override. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected File adm1file
protected File adm2file
protected File countryFile
protected File featuresFile
protected OutputStreamWriter adm1fileOutputStreamWriter
protected OutputStreamWriter adm2fileOutputStreamWriter
protected OutputStreamWriter countryfileOutputStreamWriter
protected OutputStreamWriter featuresfileOutputStreamWriter
protected Map<Long,String> countryMap
protected Map<Long,String> adm1Map
protected Map<Long,String> adm2Map
| Constructor Detail |
|---|
public GeonamesAlternateNamesExtracter()
| Method Detail |
|---|
protected void processData(String line)
AbstractSimpleImporterProcessor
processData in class AbstractSimpleImporterProcessorline - the line to processprotected boolean lineIsAnAlternatNameForAdm2(Long featureId)
protected boolean lineIsAnAlternateNameForAdm1(Long featureId)
protected boolean lineIsAnAlternateNameForCountry(Long featureId)
public boolean shouldBeSkipped()
shouldBeSkipped in interface IImporterProcessorshouldBeSkipped in class AbstractSimpleImporterProcessorprotected void tearDown()
AbstractSimpleImporterProcessor
tearDown in class AbstractSimpleImporterProcessorprotected void initFiles()
public void setup()
AbstractSimpleImporterProcessor
setup in class AbstractSimpleImporterProcessorprotected Map<Long,String> populateMapFromList(List<Long> list)
protected boolean shouldIgnoreFirstLine()
AbstractSimpleImporterProcessor
shouldIgnoreFirstLine in class AbstractSimpleImporterProcessorprotected boolean shouldIgnoreComments()
AbstractSimpleImporterProcessor
shouldIgnoreComments in class AbstractSimpleImporterProcessorAbstractSimpleImporterProcessor.COMMENT_STARTprotected void setCommitFlushMode()
AbstractSimpleImporterProcessor
setCommitFlushMode in class AbstractSimpleImporterProcessorAbstractSimpleImporterProcessor.flushAndClear()protected void flushAndClear()
AbstractSimpleImporterProcessor
flushAndClear in class AbstractSimpleImporterProcessorprotected int getNumberOfColumns()
getNumberOfColumns in class AbstractSimpleImporterProcessorprotected File[] getFiles()
getFiles in class AbstractSimpleImporterProcessorImporterHelperpublic List<NameValueDTO<Integer>> rollback()
IImporterProcessor
public void setAdmDao(IAdmDao admDao)
public void setCountryDao(ICountryDao countryDao)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||