@@ -0,0 +1,1853 @@
+package fi.nls.oskari.control.statistics.plugins.pxweb.parser;%0A%0Aimport fi.nls.oskari.control.statistics.data.RegionValue;%0Aimport fi.nls.oskari.control.statistics.plugins.db.DatasourceLayer;%0Aimport fi.nls.oskari.util.PropertyUtil;%0Aimport org.json.JSONArray;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport java.util.Optional;%0A%0Apublic class TKValueProcessor extends ValueProcessor %7B%0A%0A    private Map%3CString, String%3E regionsetType = new HashMap%3C%3E();%0A%0A    public TKValueProcessor() %7B%0A        String propertiesPrefix = %22stats.tk.%22;%0A        PropertyUtil.getPropertyNamesStartingWith(propertiesPrefix).stream()%0A                .forEach(propName -%3E %7B%0A                    String regionType = propName.substring(propertiesPrefix.length() + 1);%0A                    regionsetType.put(regionType.toLowerCase(), PropertyUtil.get(propName));%0A                %7D);%0A    %7D%0A    public Optional%3CRegionValue%3E getRegionValue(JSONArray values, String regionId, int valueIndex, DatasourceLayer layer) %7B%0A        Optional%3CRegionValue%3E value = super.getRegionValue(values, regionId, valueIndex, layer);%0A        if(!value.isPresent()) %7B%0A            return value;%0A        %7D%0A        // got value, check if regionid has prefix%0A        String type = layer.getConfig().optString(%22regionType%22);%0A        if(type == null) %7B%0A            return value;%0A        %7D%0A        String regionIdPrefix = regionsetType.get(type.toLowerCase());%0A        if(regionIdPrefix == null) %7B%0A            return value;%0A        %7D%0A        RegionValue v = value.get();%0A        if(!v.getRegion().startsWith(regionIdPrefix)) %7B%0A            // not a regino in this regionset%0A            return Optional.empty();%0A        %7D%0A        // take out the prefix%0A        String newRegionId = v.getRegion().substring(regionIdPrefix.length() +1);%0A        return Optional.of(new RegionValue(newRegionId, v.getValue()));%0A    %7D%0A%7D%0A

Add prefix processor for Tilastokeskus