org.apache.cocoon.i18n
Interface BundleFactory

All Known Implementing Classes:
XMLResourceBundleFactory

public interface BundleFactory

Bundle Factory implementations are responsible for loading and providing particular types of resource bundles, implementors of Bundle interface.

Version:
$Id: BundleFactory.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Nested Class Summary
static class BundleFactory.ConfigurationKeys
          Constants for bundle factory configuration keys
 
Field Summary
static String ROLE
          Bundle factory ROLE name
 
Method Summary
 void release(Bundle bundle)
          Releases a bundle back to the bundle factory when it's not needed anymore.
 Bundle select(String[] directories, String bundleName, Locale locale)
          Select a bundle based on the catalogue base location, bundle name, and the locale.
 Bundle select(String bundleName, Locale locale)
          Select a bundle based on the bundle name and the locale from the default catalogue.
 Bundle select(String bundleName, String locale)
          Select a bundle based on the bundle name and the locale name from the default catalogue.
 Bundle select(String base, String bundleName, Locale locale)
          Select a bundle based on the catalogue base location, bundle name, and the locale.
 Bundle select(String base, String bundleName, String locale)
          Select a bundle based on the catalogue base location, bundle name, and the locale name.
 

Field Detail

ROLE

public static final String ROLE
Bundle factory ROLE name

Method Detail

select

public Bundle select(String base,
                     String bundleName,
                     String locale)
              throws Exception
Select a bundle based on the catalogue base location, bundle name, and the locale name.

Parameters:
base - catalogue base location (URI)
bundleName - bundle name
locale - locale name
Returns:
the bundle
Throws:
Exception - if a bundle is not found

select

public Bundle select(String base,
                     String bundleName,
                     Locale locale)
              throws Exception
Select a bundle based on the catalogue base location, bundle name, and the locale.

Parameters:
base - catalogue base location (URI)
bundleName - bundle name
locale - locale
Returns:
the bundle
Throws:
Exception - if a bundle is not found

select

public Bundle select(String[] directories,
                     String bundleName,
                     Locale locale)
              throws Exception
Select a bundle based on the catalogue base location, bundle name, and the locale.

Parameters:
directories - catalogue base location (URI)
bundleName - bundle name
locale - locale
Returns:
the bundle
Throws:
Exception - if a bundle is not found

select

public Bundle select(String bundleName,
                     String locale)
              throws Exception
Select a bundle based on the bundle name and the locale name from the default catalogue.

Parameters:
bundleName - bundle name
locale - locale name
Returns:
the bundle
Throws:
Exception - if a bundle is not found

select

public Bundle select(String bundleName,
                     Locale locale)
              throws Exception
Select a bundle based on the bundle name and the locale from the default catalogue.

Parameters:
bundleName - bundle name
locale - locale
Returns:
the bundle
Throws:
Exception - if a bundle is not found

release

public void release(Bundle bundle)
Releases a bundle back to the bundle factory when it's not needed anymore.

Parameters:
bundle - the bundle


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.