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 String
getImportName()
Properties
getMessages(String baseBundlename, Locale locale)
Retrieve localized messages from a message bundle.Properties
getMessages(Locale locale)
Same as getMessages(baseBundlename, locale), but uses a default baseBundlename such as "messages".String
getName()
String
getParentName()
Properties
getProperties()
InputStream
getResourceAsStream(String path)
URL
getTemplate(String name)
Theme.Type
getType()
void
init(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:
getParentName
in interfaceTheme
-
getImportName
public String getImportName()
- Specified by:
getImportName
in interfaceTheme
-
getType
public Theme.Type getType()
-
getTemplate
public URL getTemplate(String name)
- Specified by:
getTemplate
in interfaceTheme
-
getResourceAsStream
public InputStream getResourceAsStream(String path) throws IOException
- Specified by:
getResourceAsStream
in interfaceTheme
- Throws:
IOException
-
getMessages
public Properties getMessages(Locale locale) throws IOException
Description copied from interface:Theme
Same as getMessages(baseBundlename, locale), but uses a default baseBundlename such as "messages".- Specified by:
getMessages
in 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:Theme
Retrieve localized messages from a message bundle.- Specified by:
getMessages
in 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:
getProperties
in interfaceTheme
-
-