| org.apache.cocoon.i18n.XMLResourceBundleFactory
Method Summary | |
public void | configure(Configuration configuration) Configure the component. | public void | dispose() Disposes this component. | protected String | getCacheKey(String[] directories, int index, String name, Locale locale) Creates a cache key for the bundle. | protected String | getDirectory() Returns the root directory to all bundles. | protected Locale | getParentLocale(Locale locale) Returns the next locale up the parent hierarchy.
E.g. | protected String | getSourceURI(String base, String name, Locale locale) Maps a bundle name and locale to a bundle source URI. | public void | release(Bundle bundle) | public Bundle | select(String name, String locale) Select a bundle based on the bundle name and the locale name. | public Bundle | select(String name, Locale locale) Select a bundle based on the bundle name and the locale. | public Bundle | select(String directory, String name, String localeName) Select a bundle based on the catalogue base location, bundle name,
and the locale name. | public Bundle | select(String directory, String name, Locale locale) Select a bundle based on the catalogue base location, bundle name,
and the locale. | public Bundle | select(String[] directories, String name, Locale locale) Select a bundle based on the catalogue base location, bundle name,
and the locale. | protected XMLResourceBundle | selectCached(String cacheKey) Selects a bundle from the cache, and reloads it if needed. | public void | service(ServiceManager manager) | protected void | updateCache(String cacheKey, XMLResourceBundle bundle) Stores bundle in the cache. |
cache | protected Store cache(Code) | | Store of the loaded bundles
|
manager | protected ServiceManager manager(Code) | | Service Manager
|
resolver | protected SourceResolver resolver(Code) | | Source resolver
|
configure | public void configure(Configuration configuration) throws ConfigurationException(Code) | | Configure the component.
Parameters: configuration - the configuration |
dispose | public void dispose()(Code) | | Disposes this component.
|
getCacheKey | protected String getCacheKey(String[] directories, int index, String name, Locale locale) throws ComponentException(Code) | | Creates a cache key for the bundle.
the cache key |
getDirectory | protected String getDirectory()(Code) | | Returns the root directory to all bundles.
the directory path |
getParentLocale | protected Locale getParentLocale(Locale locale)(Code) | | Returns the next locale up the parent hierarchy.
E.g. the parent of new Locale("en","us","mac") would be
new Locale("en", "us", "").
Parameters: locale - the locale the parent locale |
getSourceURI | protected String getSourceURI(String base, String name, Locale locale) throws ComponentException(Code) | | Maps a bundle name and locale to a bundle source URI.
If you need a different mapping, then just override this method.
Parameters: base - the base URI for the catalogues Parameters: name - the name of the catalogue Parameters: locale - the locale of the bundle the source URI for the bundle |
select | public Bundle select(String name, String locale) throws ComponentException(Code) | | Select a bundle based on the bundle name and the locale name.
Parameters: name - bundle name Parameters: locale - locale name the bundle exception: ComponentException - if a bundle is not found |
select | public Bundle select(String name, Locale locale) throws ComponentException(Code) | | Select a bundle based on the bundle name and the locale.
Parameters: name - bundle name Parameters: locale - locale the bundle exception: ComponentException - if a bundle is not found |
select | public Bundle select(String directory, String name, String localeName) throws ComponentException(Code) | | Select a bundle based on the catalogue base location, bundle name,
and the locale name.
Parameters: directory - catalogue base location (URI) Parameters: name - bundle name Parameters: localeName - locale name the bundle exception: ComponentException - if a bundle is not found |
select | public Bundle select(String directory, String name, Locale locale) throws ComponentException(Code) | | Select a bundle based on the catalogue base location, bundle name,
and the locale.
Parameters: directory - catalogue base location (URI) Parameters: name - bundle name Parameters: locale - locale the bundle exception: ComponentException - if a bundle is not found |
select | public Bundle select(String[] directories, String name, Locale locale) throws ComponentException(Code) | | Select a bundle based on the catalogue base location, bundle name,
and the locale.
Parameters: directories - catalogue base location (URI) Parameters: name - bundle name Parameters: locale - locale the bundle exception: ComponentException - if a bundle is not found |
selectCached | protected XMLResourceBundle selectCached(String cacheKey)(Code) | | Selects a bundle from the cache, and reloads it if needed.
Parameters: cacheKey - caching key of the bundle the cached bundle; null, if not found |
service | public void service(ServiceManager manager) throws ServiceException(Code) | | |
updateCache | protected void updateCache(String cacheKey, XMLResourceBundle bundle)(Code) | | Stores bundle in the cache.
Parameters: cacheKey - caching key of the bundle Parameters: bundle - bundle to be placed in the cache |
|
|