|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.apache.avalon.framework.component.DefaultComponentSelector
|
+--org.apache.cocoon.i18n.XMLResourceBundleFactory
This is the XMLResourceBundleFactory, the method for getting and creating XMLResourceBundles.
| Inner Class Summary | |
static class |
XMLResourceBundleFactory.ConfigurationKeys
Constants for configuration keys |
| Field Summary | |
protected boolean |
cacheAtStartup
Should we load bundles to cache on startup or not? |
protected java.util.Map |
cacheNotFound
Cache for the names of the bundles that were not found |
protected java.lang.String |
directory
Root directory to all bundle names |
protected org.apache.log.Logger |
logger
The logger |
protected org.apache.avalon.framework.component.ComponentManager |
manager
Component Manager |
| Constructor Summary | |
XMLResourceBundleFactory()
Default constructor. |
|
| Method Summary | |
boolean |
cacheAtStartup()
Should we load bundles to cache on startup or not? |
void |
compose(org.apache.avalon.framework.component.ComponentManager manager)
|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Configure the component. |
void |
dispose()
|
java.lang.String |
getDirectory()
Returns the root directory to all bundles. |
protected java.lang.String |
getFileName(java.lang.String name,
java.util.Locale loc)
Maps a bundle name and locale to a full path in the filesystem. |
protected java.util.Locale |
getParentLocale(java.util.Locale loc)
Returns the next locale up the parent hierarchy. |
protected boolean |
isNotFoundBundle(java.lang.String fileName)
Checks if the bundle is in the "not-found" cache. |
void |
release(org.apache.avalon.framework.component.Component component)
|
org.apache.avalon.framework.component.Component |
select(java.lang.String name,
java.util.Locale locale)
Select a bundle based on bundle name and locale. |
org.apache.avalon.framework.component.Component |
select(java.lang.String name,
java.util.Locale loc,
boolean cacheAtStartup)
Select a bundle based on bundle name and locale. |
org.apache.avalon.framework.component.Component |
select(java.lang.String name,
java.lang.String localeName)
Select a bundle based on bundle name and locale name. |
protected org.apache.avalon.framework.component.Component |
selectCached(java.lang.String fileName)
Selects a bundle from the cache. |
org.apache.avalon.framework.component.Component |
selectFromFilename(java.lang.String fileName)
Select a bundle based on source XML file name. |
org.apache.avalon.framework.component.Component |
selectFromFilename(java.lang.String fileName,
boolean cacheAtStartup)
Select a bundle based on source XML file name. |
protected org.apache.avalon.framework.component.Component |
selectParent(java.lang.String name,
java.util.Locale loc)
Select the parent bundle of the current bundle, based on bundle name and locale. |
protected org.apache.avalon.framework.component.Component |
selectParent(java.lang.String name,
java.util.Locale loc,
boolean cacheAtStartup)
Select the parent bundle of the current bundle, based on bundle name and locale. |
void |
setLogger(org.apache.log.Logger logger)
Set the logger. |
protected void |
updateCache(java.lang.String fileName,
XMLResourceBundle bundle)
Checks if the bundle is in the "not-found" cache. |
| Methods inherited from class org.apache.avalon.framework.component.DefaultComponentSelector |
checkWriteable, getComponentMap, hasComponent, makeReadOnly, put, select |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected boolean cacheAtStartup
protected java.lang.String directory
protected java.util.Map cacheNotFound
protected org.apache.log.Logger logger
protected org.apache.avalon.framework.component.ComponentManager manager
| Constructor Detail |
public XMLResourceBundleFactory()
| Method Detail |
public void compose(org.apache.avalon.framework.component.ComponentManager manager)
compose in interface org.apache.avalon.framework.component.Composablepublic void dispose()
dispose in interface org.apache.avalon.framework.activity.Disposablepublic void setLogger(org.apache.log.Logger logger)
setLogger in interface org.apache.avalon.framework.logger.Loggablelogger - the logger
public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableconfiguration - the configuration
public org.apache.avalon.framework.component.Component select(java.lang.String name,
java.util.Locale locale)
throws org.apache.avalon.framework.component.ComponentException
name - bundle namelocale - localeorg.apache.avalon.framework.component.ComponentException - if a bundle is not found
public org.apache.avalon.framework.component.Component select(java.lang.String name,
java.util.Locale loc,
boolean cacheAtStartup)
throws org.apache.avalon.framework.component.ComponentException
name - bundle namelocale - localecacheAtStartup - cache all the keys when constructing?org.apache.avalon.framework.component.ComponentException - if a bundle is not found
protected org.apache.avalon.framework.component.Component selectParent(java.lang.String name,
java.util.Locale loc)
name - bundle namelocale - locale
protected org.apache.avalon.framework.component.Component selectParent(java.lang.String name,
java.util.Locale loc,
boolean cacheAtStartup)
name - bundle namelocale - localecacheAtStartup - cache all the keys when constructing?
public org.apache.avalon.framework.component.Component select(java.lang.String name,
java.lang.String localeName)
throws org.apache.avalon.framework.component.ComponentException
name - bundle namelocaleName - locale nameorg.apache.avalon.framework.component.ComponentException - if a bundle is not found
public org.apache.avalon.framework.component.Component selectFromFilename(java.lang.String fileName)
throws org.apache.avalon.framework.component.ComponentException
fileName - file nameorg.apache.avalon.framework.component.ComponentException - if a bundle is not found
public org.apache.avalon.framework.component.Component selectFromFilename(java.lang.String fileName,
boolean cacheAtStartup)
throws org.apache.avalon.framework.component.ComponentException
fileName - file namecacheAtStartup - cache all the keys when constructing?org.apache.avalon.framework.component.ComponentException - if a bundle is not foundpublic void release(org.apache.avalon.framework.component.Component component)
release in class org.apache.avalon.framework.component.DefaultComponentSelectorprotected java.util.Locale getParentLocale(java.util.Locale loc)
locale - the locale
protected java.lang.String getFileName(java.lang.String name,
java.util.Locale loc)
locale - the localeprotected org.apache.avalon.framework.component.Component selectCached(java.lang.String fileName)
fileName - file name of the bundleprotected boolean isNotFoundBundle(java.lang.String fileName)
fileName - file name of the bundle
protected void updateCache(java.lang.String fileName,
XMLResourceBundle bundle)
fileName - file name of the bundlepublic java.lang.String getDirectory()
public boolean cacheAtStartup()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||