Package org.keycloak.theme
Class ClassLoaderTheme
- java.lang.Object
-
- org.keycloak.theme.ClassLoaderTheme
-
- All Implemented Interfaces:
Theme
public class ClassLoaderTheme extends Object implements Theme
- Author:
- Stian Thorgersen
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.keycloak.theme.Theme
Theme.Type
-
-
Constructor Summary
Constructors Constructor Description ClassLoaderTheme(String name, Theme.Type type, ClassLoader classLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetImportName()PropertiesgetMessages(String baseBundlename, Locale locale)Retrieve localized messages from a message bundle.PropertiesgetMessages(Locale locale)Same as getMessages(baseBundlename, locale), but uses a default baseBundlename such as "messages".StringgetName()StringgetParentName()PropertiesgetProperties()InputStreamgetResourceAsStream(String path)URLgetTemplate(String name)Theme.TypegetType()voidinit(String name, Theme.Type type, ClassLoader classLoader)
-
-
-
Constructor Detail
-
ClassLoaderTheme
public ClassLoaderTheme(String name, Theme.Type type, ClassLoader classLoader) throws IOException
- Throws:
IOException
-
-
Method Detail
-
init
public void init(String name, Theme.Type type, ClassLoader classLoader) throws IOException
- Throws:
IOException
-
getParentName
public String getParentName()
- Specified by:
getParentNamein interfaceTheme
-
getImportName
public String getImportName()
- Specified by:
getImportNamein interfaceTheme
-
getType
public Theme.Type getType()
-
getTemplate
public URL getTemplate(String name)
- Specified by:
getTemplatein interfaceTheme
-
getResourceAsStream
public InputStream getResourceAsStream(String path) throws IOException
- Specified by:
getResourceAsStreamin interfaceTheme- Throws:
IOException
-
getMessages
public Properties getMessages(Locale locale) throws IOException
Description copied from interface:ThemeSame as getMessages(baseBundlename, locale), but uses a default baseBundlename such as "messages".- Specified by:
getMessagesin interfaceTheme- Parameters:
locale- The locale of the desired message bundle.- Returns:
- The localized messages from the bundle.
- Throws:
IOException- If bundle can not be read.
-
getMessages
public Properties getMessages(String baseBundlename, Locale locale) throws IOException
Description copied from interface:ThemeRetrieve localized messages from a message bundle.- Specified by:
getMessagesin interfaceTheme- Parameters:
baseBundlename- The base name of the bundle, such as "messages" in messages_en.properties.locale- The locale of the desired message bundle.- Returns:
- The localized messages from the bundle.
- Throws:
IOException- If bundle can not be read.
-
getProperties
public Properties getProperties()
- Specified by:
getPropertiesin interfaceTheme
-
-