Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.javatools.resourcebundle
Class ResourceBundleManager

java.lang.Object
  extended by oracle.javatools.resourcebundle.ResourceBundleManager
Direct Known Subclasses:
ResourceBundleManagerDT, ResourceBundleManagerRT

public abstract class ResourceBundleManager
extends java.lang.Object

Manager class for resource bundle support in the Oracle Fusion Platform. Callers should obtain obtain a reference to this class through the static getResourceBundleManager()method. ResourceBundleWrapper instances are obtained via the getBundle() of the ResourceBundleManagerRT or ResourceBundleManagerDT subclasses, and should be released using releaseBundle(ResourceBundleWrapper) when they are no longer used. Design-time implementations of the (@link ResourceBundleWrapper} must extend oracle.ide.resourcebundle.NodeResourceBundle so that the ResourceBundleManager can properly interract with the implementation. NodeResourceBundle contains methods that only the design-time ResourceBundleManagerDT implementation will use, such as delete() and Node methods such as save() Run-time implementations of the ResourceBundleWrapper must extend <@link ResourceBundleWrapperRT}.


Nested Class Summary
static class ResourceBundleManager.BundleCache<K,V>
           
 
Field Summary
protected  ResourceBundleManager.BundleCache<java.lang.String,ResourceBundleWrapper> _bundleMap
           
protected static java.util.List<ResourceBundleType> _bundleTypesList
           
protected static ChainedBundleFactory _chainedBundleFactory
           
protected  ResourceBundleKeyGenerator _keyGenerator
           
static java.lang.String NULL_VALUE_RESOURCE_ID
           
static java.lang.String SYSTEM_BUNDLE_ID
           
 
Constructor Summary
protected ResourceBundleManager()
          This should only be called by subclasses
 
Method Summary
abstract  boolean deleteBundle(ResourceBundleWrapper bundle)
          Deletes the given bundle.
static AppBundleInfoFactory getAppBundleInfoFactory()
          Gets the AppBundleInfoFactory
static ChainedBundleFactory getChainedBundleFactory()
          Gets the ChainedBundleFactory if one has been registered
 ResourceBundleKeyGenerator getDefaultResourceKeyGenerator()
          Gets the default ResourceKeyGenerator for the system.
static ResourceBundleManager getResourceBundleManager()
          Gets the ResourceBundle manager.
 java.util.List<ResourceBundleType> getResourceBundleTypes()
          Retrieves the list of ResourceBundleTypes that have been registered
abstract  boolean mergeBundles(ResourceBundleWrapper newBundle, ResourceBundleWrapper oldBundle)
          Merges the contents of oldBundle into newBundle
 void registerResourceBundleType(ResourceBundleType bundleType)
          Registers a new ResourceBundleType with the system.
abstract  boolean releaseBundle(ResourceBundleWrapper bundle)
          Releases the ResourceBundleWrapper and all associated resources, once released the old resource bundle should not be used anymore, or it will throw an IllegalStateException.
static void setAppBundleInfoFactory(AppBundleInfoFactory factory)
          Sets the AppBundleInfoFactory
static void setChainedBundleFactory(ChainedBundleFactory factory)
          Sets the ChainedBundleFactory
 void setDefaultResourceKeyGenerator(ResourceBundleKeyGenerator generator)
          Sets the default ResourceKeyGenerator for the system.
static void setResourceBundleManager(ResourceBundleManager bundleManager)
          Publishes the specified ResourceBundleManager as the active instance in the IDE.
abstract  boolean splitBundle(ResourceBundleWrapper newBundle, ResourceBundleWrapper oldBundle, java.util.Set<java.lang.String> keysToMove)
          Splits a ResourceBundleWrapper into two.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_bundleMap

protected ResourceBundleManager.BundleCache<java.lang.String,ResourceBundleWrapper> _bundleMap

_bundleTypesList

protected static java.util.List<ResourceBundleType> _bundleTypesList

_keyGenerator

protected ResourceBundleKeyGenerator _keyGenerator

_chainedBundleFactory

protected static ChainedBundleFactory _chainedBundleFactory

SYSTEM_BUNDLE_ID

public static final java.lang.String SYSTEM_BUNDLE_ID
See Also:
Constant Field Values

NULL_VALUE_RESOURCE_ID

public static final java.lang.String NULL_VALUE_RESOURCE_ID
See Also:
Constant Field Values
Constructor Detail

ResourceBundleManager

protected ResourceBundleManager()
This should only be called by subclasses

Method Detail

deleteBundle

public abstract boolean deleteBundle(ResourceBundleWrapper bundle)
Deletes the given bundle.

Parameters:
bundle - Deletes the given resource bundle.
Returns:
true on success.
Throws:
java.lang.NullPointerException - if bundle is null

mergeBundles

public abstract boolean mergeBundles(ResourceBundleWrapper newBundle,
                                     ResourceBundleWrapper oldBundle)
Merges the contents of oldBundle into newBundle

Parameters:
newBundle - The new resource bundle.
oldBundle - The old resource bundle, whose contents are merged into the new bundle.
Returns:
true on success.
Throws:
java.lang.NullPointerException - if newBundle or oldBundle is null

splitBundle

public abstract boolean splitBundle(ResourceBundleWrapper newBundle,
                                    ResourceBundleWrapper oldBundle,
                                    java.util.Set<java.lang.String> keysToMove)
Splits a ResourceBundleWrapper into two. The keys contained in keysToMove will be removed from oldBundle and added to newBundle

Parameters:
newBundle - The new bundle contains the keys in keysTomove
oldBundle - The original (old) resource bundle
keysToMove - The set of keys to move
Returns:
true on success.
Throws:
java.lang.NullPointerException - if newBundle,oldBundle, or keysToMove is null
java.lang.IllegalArgumentException - if keysToMove is an empty Set.

releaseBundle

public abstract boolean releaseBundle(ResourceBundleWrapper bundle)
Releases the ResourceBundleWrapper and all associated resources, once released the old resource bundle should not be used anymore, or it will throw an IllegalStateException.

Parameters:
bundle - The resource bundle to release.
Returns:
true on success.
Throws:
java.lang.NullPointerException - if bundle is null

setDefaultResourceKeyGenerator

public void setDefaultResourceKeyGenerator(ResourceBundleKeyGenerator generator)
Sets the default ResourceKeyGenerator for the system.

Parameters:
generator - The default ResourceKeyGenerator for the system.
Throws:
java.lang.NullPointerException - if generator is null

getDefaultResourceKeyGenerator

public ResourceBundleKeyGenerator getDefaultResourceKeyGenerator()
Gets the default ResourceKeyGenerator for the system.

Returns:
the default ResourceKeyGenerator for the system, may return null

getResourceBundleManager

public static ResourceBundleManager getResourceBundleManager()
Gets the ResourceBundle manager.

Returns:
the ResourceBundle manager

setResourceBundleManager

public static void setResourceBundleManager(ResourceBundleManager bundleManager)
Publishes the specified ResourceBundleManager as the active instance in the IDE.


registerResourceBundleType

public void registerResourceBundleType(ResourceBundleType bundleType)
Registers a new ResourceBundleType with the system. ResourceBundleTypes will be created from data registered in an extension manifest via the resource-bundle-hook If you register a new ResourceBundleWrapper class with the same id as an existing type, the new type will override the previous type registration.

Parameters:
bundleType - the resource bundle type to add to the system
Throws:
java.lang.NullPointerException - if bundleType is null

getResourceBundleTypes

public java.util.List<ResourceBundleType> getResourceBundleTypes()
Retrieves the list of ResourceBundleTypes that have been registered

Returns:
the list of resource bundle types that have been registered

getChainedBundleFactory

public static ChainedBundleFactory getChainedBundleFactory()
Gets the ChainedBundleFactory if one has been registered

Returns:
the registered ChainedBundleFactory

setChainedBundleFactory

public static void setChainedBundleFactory(ChainedBundleFactory factory)
Sets the ChainedBundleFactory

Parameters:
factory - the ChainedBundleFactory to use when creating chained bundles

getAppBundleInfoFactory

public static AppBundleInfoFactory getAppBundleInfoFactory()
Gets the AppBundleInfoFactory

Returns:
the registered AppBundleInfoFactory

setAppBundleInfoFactory

public static void setAppBundleInfoFactory(AppBundleInfoFactory factory)
Sets the AppBundleInfoFactory

Parameters:
factory - the AppBundleInfoFactory to use when creating an AppBundleInfo

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.