Package org.djunits.locale
Class VerifyLocalizations
- java.lang.Object
-
- org.djunits.locale.VerifyLocalizations
-
public class VerifyLocalizations extends Object
Verify that all localizations contain all keys.- Author:
- Peter Knoppers
-
-
Constructor Summary
Constructors Constructor Description VerifyLocalizations()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckUnitSystemsLocale()Check that all UnitSystems have valid a nameKey and a valid abbreviationKey and test those keys in all available localizations.(package private) static StringfixUnicodeEscapes(String in)Replace unicode escapes by the corresponding character.voidverifyLocalizations()Verify that all localizations have the same set of keys as the localeunit.properties file and check that a string using each of the acceptable unit names is correctly parsed.
-
-
-
Method Detail
-
fixUnicodeEscapes
static String fixUnicodeEscapes(String in)
Replace unicode escapes by the corresponding character. Based on https://stackoverflow.com/questions/37502058/replace-unicode-escapes-with-the-corresponding-character- Parameters:
in- String; the input string to process- Returns:
- String the processed input string
-
verifyLocalizations
public void verifyLocalizations() throws IOException, ClassNotFoundException, NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, URISyntaxExceptionVerify that all localizations have the same set of keys as the localeunit.properties file and check that a string using each of the acceptable unit names is correctly parsed.- Throws:
IOException- when a file could not be readClassNotFoundException- ...SecurityException- ...NoSuchMethodException- ...InvocationTargetException- ...IllegalArgumentException- ...IllegalAccessException- ...URISyntaxException- ...
-
checkUnitSystemsLocale
public final void checkUnitSystemsLocale() throws URISyntaxExceptionCheck that all UnitSystems have valid a nameKey and a valid abbreviationKey and test those keys in all available localizations.- Throws:
URISyntaxException- on error
-
-