Package org.keycloak.theme
Class ClassLoaderTheme
java.lang.Object
org.keycloak.theme.FileBasedTheme
org.keycloak.theme.ClassLoaderTheme
- All Implemented Interfaces:
Theme
- Author:
- Stian Thorgersen
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.theme.Theme
Theme.Type
-
Field Summary
Fields inherited from interface org.keycloak.theme.Theme
ACCOUNT_RESOURCE_PROVIDER_KEY, CONTENT_HASH_PATTERN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEnhancedMessages
(RealmModel realm, Locale locale) Retrieve localized messages from a message bundle named "messages" and enhance those messages with messages from realm localization.getMessages
(Locale locale) Same as getMessages(baseBundlename, locale), but uses a default baseBundlename such as "messages".getName()
getResourceAsStream
(String path) getTemplate
(String name) getType()
void
init
(String name, Theme.Type type, ClassLoader classLoader) protected void
loadBundle
(String baseBundlename, Locale locale, Properties m) Methods inherited from class org.keycloak.theme.FileBasedTheme
getMessages, toBundleName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.theme.Theme
hasContentHash
-
Constructor Details
-
ClassLoaderTheme
- Throws:
IOException
-
-
Method Details
-
init
- Throws:
IOException
-
getName
-
getParentName
-
getImportName
-
getType
-
getTemplate
-
getResourceAsStream
- Throws:
IOException
-
getMessages
Description copied from interface:Theme
Same as getMessages(baseBundlename, locale), but uses a default baseBundlename such as "messages".- Parameters:
locale
- The locale of the desired message bundle.- Returns:
- The localized messages from the bundle.
- Throws:
IOException
- If bundle can not be read.
-
loadBundle
- Specified by:
loadBundle
in classFileBasedTheme
- Throws:
IOException
-
getEnhancedMessages
Description copied from interface:Theme
Retrieve localized messages from a message bundle named "messages" and enhance those messages with messages from realm localization.In general, the translation for the most specific applicable language is used. If a translation exists both in the message bundle and realm localization, the realm localization translation is used.
- Parameters:
realm
- The realm from which the localization should be retrievedlocale
- The locale of the desired message bundle.- Returns:
- The localized messages from the bundle, enhanced with realm localization
- Throws:
IOException
- If bundle can not be read.
-
getProperties
-