Skip to content

StateProvinceProcessor

cgendreau edited this page Apr 5, 2013 · 5 revisions

This processor will standardize the name of a province or state based on a controlled vocabulary list(based on the ISO 3166-2 standard) associated with a country. The state/province list represents the country as it is today. There is no historic data included. The spelling will be standardized and an historic mapping could be done if there is no ambiguity. "Labrador" can be mapped to "Newfoundland and Labrador" but "Northwest Territories" could not be mapped to "Nunavut".

AbstractDataProcessor spProcessor = new StateProvinceProcessor<CAProvince>(Country.CANADA, CAProvince.class);
MockOccurrenceModel mockRawModel = new MockOccurrenceModel();
MockOccurrenceModel mockModel = new MockOccurrenceModel();

mockRawModel.setStateprovince("Labrador");
spProcessor.processBean(mockRawModel, mockModel, null, null);
System.out.println(mockModel.getStateprovince());
//prints : Newfoundland and Labrador
Clone this wiki locally