Package org.dspace.statistics.util
Class LocationUtils
java.lang.Object
org.dspace.statistics.util.LocationUtils
Mapping between Country codes, English Country names,
Continent Codes, and English Continent names
- Author:
- kevinvandevelde at atmire.com, ben at atmire.com
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetContinentCode(String countryCode) Map DSpace continent codes onto ISO country codes.static StringgetContinentName(String continentCode, Locale locale) Map DSpace continent codes onto localized continent names.static StringgetCountryCode(String countryName) Revert a country name back into a country code (iso2) Source: https://stackoverflow.com/a/38588988static StringgetCountryName(String countryCode, Locale locale) Map ISO country codes onto localized country names.
-
Method Details
-
getContinentCode
Map DSpace continent codes onto ISO country codes.- Parameters:
countryCode- ISO 3166-1 alpha-2 country code.- Returns:
- DSpace 2-character code for continent containing that country, or an error message string.
-
getContinentName
Map DSpace continent codes onto localized continent names.- Parameters:
continentCode- DSpace 2-character code for a continent.locale- The desired localization.- Returns:
- Localized name of the continent, or an error message string.
-
getCountryCode
Revert a country name back into a country code (iso2) Source: https://stackoverflow.com/a/38588988- Parameters:
countryName- Name of country (according to Locale)- Returns:
- Corresponding iso2 country code
-
getCountryName
Map ISO country codes onto localized country names.- Parameters:
countryCode- ISO 3166-1 alpha-2 country code.locale- Desired localization.- Returns:
- Localized name of the country, or an error message string.
-