Class ClassLoaderTheme

java.lang.Object
org.keycloak.theme.FileBasedTheme
org.keycloak.theme.ClassLoaderTheme
All Implemented Interfaces:
Theme

public class ClassLoaderTheme extends FileBasedTheme
Author:
Stian Thorgersen
  • Constructor Details

  • Method Details

    • init

      public void init(String name, Theme.Type type, ClassLoader classLoader) throws IOException
      Throws:
      IOException
    • getName

      public String getName()
    • getParentName

      public String getParentName()
    • getImportName

      public String getImportName()
    • getType

      public Theme.Type getType()
    • getTemplate

      public URL getTemplate(String name)
    • getResourceAsStream

      public InputStream getResourceAsStream(String path) throws IOException
      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".
      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

      protected void loadBundle(String baseBundlename, Locale locale, Properties m) throws IOException
      Specified by:
      loadBundle in class FileBasedTheme
      Throws:
      IOException
    • getEnhancedMessages

      public Properties getEnhancedMessages(RealmModel realm, Locale locale) throws IOException
      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 retrieved
      locale - 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

      public Properties getProperties()