public class LanguagesManager extends Object implements Configurable, Component
Modifier and Type | Field and Description |
---|---|
private Map<String,Language> |
_languages |
static String |
ROLE
The component role
|
Constructor and Description |
---|
LanguagesManager() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Configuration configuration) |
Map<String,Language> |
getAvailableLanguages()
Get the list of possible languages
|
List<Map<String,Object>> |
getAvailableLanguagesAsJsonObject()
Get the list of available languages as a JSON object
|
Language |
getLanguage(String code)
Get the language by its code
|
protected Map<String,Object> |
toJson(Language language)
Return the JSON representation of a language
|
private Map<String,Language> _languages
public LanguagesManager()
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public Language getLanguage(String code)
code
- The language codenull
if not foundpublic Map<String,Language> getAvailableLanguages()
public List<Map<String,Object>> getAvailableLanguagesAsJsonObject()