Package com.suncode.pwfl.translation
Class PropertiesTranslator
java.lang.Object
com.suncode.pwfl.translation.AbstractTranslator
com.suncode.pwfl.translation.PropertiesTranslator
- All Implemented Interfaces:
ClassLoaderTranslator
,PackageTranslator
,Translator
Default Translator implementation based on
*.properties
files with key-based
translations. Default encoding is UTF-8.- Author:
- Cezary Kozar 11 sie 2015
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
getMessages
(Locale locale) Returns key-value map with every available translations for given locale.int
hashCode()
protected String
resolveMessage
(String key, Locale locale, Object... args) void
setBasename
(String basename) void
setBasenames
(String... basenames) void
setDefaultEncoding
(String charset) void
setResourceLoader
(org.springframework.core.io.ResourceLoader resourceLoader) Methods inherited from class com.suncode.pwfl.translation.AbstractTranslator
addTranslatedPackage, getLocalizedString, getLocalizedString, getLocalizedString, getLocalizedString, getLocalizedString, getLocalizedString, getLocalizedString, getLocalizedString, getLocalizedString, getLocalizedString, getMessage, getMessage, getMessage, getMessage, getParent, setParent, setTranslatedClassLoader, translatedClassLoader, translatedPackages
-
Constructor Details
-
PropertiesTranslator
public PropertiesTranslator()
-
-
Method Details
-
setBasename
-
setBasenames
-
setDefaultEncoding
-
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) -
resolveMessage
protected String resolveMessage(String key, Locale locale, Object... args) throws NoTranslationException - Specified by:
resolveMessage
in classAbstractTranslator
- Throws:
NoTranslationException
-
getMessages
Description copied from interface:Translator
Returns key-value map with every available translations for given locale. -
equals
- Overrides:
equals
in classAbstractTranslator
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractTranslator
-