Groovy Documentation

org.codehaus.groovy.grails.context.support
[Java] Class PluginAwareResourceBundleMessageSource

java.lang.Object
  org.springframework.context.support.ReloadableResourceBundleMessageSource
      org.codehaus.groovy.grails.context.support.PluginAwareResourceBundleMessageSource
All Implemented Interfaces:
GrailsApplicationAware, InitializingBean, PluginManagerAware

public class PluginAwareResourceBundleMessageSource
extends ReloadableResourceBundleMessageSource

A ReloadableResourceBundleMessageSource that is capable of loading message sources from plugins.

Authors:
Graeme Rocher
Since:
1.1


Field Summary
protected GrailsApplication application

protected java.util.List pluginBaseNames

protected GrailsPluginManager pluginManager

 
Method Summary
void afterPropertiesSet()

protected PropertiesHolder getMergedPluginProperties(java.util.Locale locale)

Get a PropertiesHolder that contains the actually visible properties for a Locale, after merging all specified resource bundles.

java.util.List getPluginBaseNames()

protected Resource[] getPluginBundles(java.lang.String pluginName)

protected java.text.MessageFormat resolveCode(java.lang.String code, java.util.Locale locale)

protected java.text.MessageFormat resolveCodeFromPlugins(java.lang.String code, java.util.Locale locale)

Attempts to resolve a MessageFormat for the code from the list of plugin base names

protected java.lang.String resolveCodeWithoutArguments(java.lang.String code, java.util.Locale locale)

protected java.lang.String resolveCodeWithoutArgumentsFromPlugins(java.lang.String code, java.util.Locale locale)

Attempts to resolve a String for the code from the list of plugin base names

void setCacheSeconds(int cacheSeconds)

void setGrailsApplication(GrailsApplication grailsApplication)

void setPluginBaseNames(java.util.List pluginBaseNames)

void setPluginManager(GrailsPluginManager pluginManager)

void setResourceLoader(ResourceLoader resourceLoader)

 

Field Detail

application

protected GrailsApplication application


pluginBaseNames

protected java.util.List pluginBaseNames


pluginManager

protected GrailsPluginManager pluginManager


 
Method Detail

afterPropertiesSet

public void afterPropertiesSet()


getMergedPluginProperties

protected PropertiesHolder getMergedPluginProperties(java.util.Locale locale)
Get a PropertiesHolder that contains the actually visible properties for a Locale, after merging all specified resource bundles. Either fetches the holder from the cache or freshly loads it.

Only used when caching resource bundle contents forever, i.e. with cacheSeconds < 0. Therefore, merged properties are always cached forever.


getPluginBaseNames

public java.util.List getPluginBaseNames()


getPluginBundles

protected Resource[] getPluginBundles(java.lang.String pluginName)


resolveCode

@Override
protected java.text.MessageFormat resolveCode(java.lang.String code, java.util.Locale locale)


resolveCodeFromPlugins

protected java.text.MessageFormat resolveCodeFromPlugins(java.lang.String code, java.util.Locale locale)
Attempts to resolve a MessageFormat for the code from the list of plugin base names
Parameters:
code - The code
locale - The locale
Returns:
a MessageFormat


resolveCodeWithoutArguments

@Override
protected java.lang.String resolveCodeWithoutArguments(java.lang.String code, java.util.Locale locale)


resolveCodeWithoutArgumentsFromPlugins

protected java.lang.String resolveCodeWithoutArgumentsFromPlugins(java.lang.String code, java.util.Locale locale)
Attempts to resolve a String for the code from the list of plugin base names
Parameters:
code - The code
locale - The locale
Returns:
a MessageFormat


setCacheSeconds

@Override
public void setCacheSeconds(int cacheSeconds)


setGrailsApplication

public void setGrailsApplication(GrailsApplication grailsApplication)


setPluginBaseNames

public void setPluginBaseNames(java.util.List pluginBaseNames)


setPluginManager

public void setPluginManager(GrailsPluginManager pluginManager)


setResourceLoader

@Override
public void setResourceLoader(ResourceLoader resourceLoader)


 

Groovy Documentation