Skip to content

CountryContinentProcessor

cgendreau edited this page Apr 5, 2013 · 7 revisions

This processor allows you to find the continent name of a country. The processing is a simple match between the ISO 3166-1 alpha 2 country code and the continent. The continents are taken from the canadensys-core enumeration, a seven-continent model. The matching is made according to a compiled data file.

AbstractDataProcessor ccProcessor = new CountryContinentProcessor("countryISOLetterCode", "continent");
//use mock objects for demo		
MockCountryCodeHolder mockRawModel = new MockCountryCodeHolder();
MockOccurrenceModel mockModel = new MockOccurrenceModel();

//set NO (Norway)
mockRawModel.setCountryISOLetterCode("NO");
ccProcessor.processBean(mockRawModel, mockModel, null, null);
		
System.out.println(mockModel.getContinent());
//prints : Europe
Clone this wiki locally