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

E13403-03

oracle.javatools.resourcebundle
Class ResourceBundleWrapperRT

java.lang.Object
  extended by oracle.javatools.resourcebundle.ResourceBundleWrapperRT
All Implemented Interfaces:
ResourceBundleWrapper
Direct Known Subclasses:
ResourceBundleAdapter

public abstract class ResourceBundleWrapperRT
extends java.lang.Object
implements ResourceBundleWrapper

The ResourceBundleWrapperRT provides some of the base implementation of a ResourceBundleWrapper for run-time. Any implementation of a resource bundle wrapper for run-time must extend this class for proper functioning in the run-time version of the ResourceBundleManager


Nested Class Summary
protected static class ResourceBundleWrapperRT.SearchType
          SearchType (EXACT_MATCH, CONTAINS_MATCH, or METADATA_MATCH)
 
Nested classes/interfaces inherited from interface oracle.javatools.resourcebundle.ResourceBundleWrapper
ResourceBundleWrapper.KeyInfo
 
Field Summary
protected  ResourceBundleWrapperRT _parent
           
 
Constructor Summary
ResourceBundleWrapperRT()
           
 
Method Summary
 java.lang.String addEntry(java.lang.String text, java.util.Map<java.lang.String,java.lang.String> metadata)
          Adds a new entry (value, and optional metadata) into the resource bundle and returns an automatically generated resource bundle key.
 boolean addEntry(java.lang.String key, java.lang.String text, java.util.Map<java.lang.String,java.lang.String> metadata)
          Adds a new entry (key, value, and optional metadata) into the resource bundle.
 ResourceBundleOperationResult addEntryNoDialog(java.lang.String key, java.lang.String text, java.util.Map<java.lang.String,java.lang.String> metadata)
          Adds a new entry (key, value, and optional metadata) into the resource bundle.
 void addResourceBundleListener(ResourceBundleListener listener)
          Registers a listenerto receive ResourceBundleEvents when the contents of the resource bundle change.
 boolean deleteEntry(java.lang.String key)
          Deletes the resource bundle entry identified by key.
protected  java.util.Set<java.lang.String> findKeys(ResourceBundleWrapperRT.SearchType searchType, java.lang.Object searchConstraint)
          Returns a set of keys that satisfy the search
 java.lang.String getBundleId()
          Gets the bundleId associated with this instance of ResourceBundleWrapper
 java.util.Map<java.lang.String,java.lang.String> getChainedKeyValueMap()
          Gets the key-value map for the bundle chained with any parent bundles For example, if the bundle is for BundleA_en_US the parent chain will include BundleA_en and Bundle
 ResourceBundleKeyGenerator getKeyGenerator()
          Gets the key generator to use for making an automatic key name
abstract  java.util.Map<java.lang.String,java.lang.String> getKeyValueMap()
          Gets the map of key-values for this bundle.
protected  java.util.Map<java.lang.String,java.lang.String> getMetadataFromParentChain(java.lang.String key)
           
protected  ResourceBundleWrapperRT getParent()
           
 java.util.List<ResourceBundleWrapperRT> getParentChain()
           
protected  java.util.List<java.lang.String> getParentList()
           
 java.lang.String getString(java.lang.String key)
          Gets the translated text (value) identified by key
protected abstract  void parse(java.net.URL url)
           
 void removeResourceBundleListener(ResourceBundleListener listener)
          Removes a listenerthat received ResourceBundleEvents.
 void setBundleId(java.lang.String bundleId)
          Sets the bundleId associated with this instance of ResourceBundleWrapper
 void setKeyGenerator(ResourceBundleKeyGenerator generator)
          Sets the key generator to use when using an automatic key name from ResourceBundleWrapper.addEntry(String,Map).
 void setParentList(java.util.List<java.lang.String> parentList)
           
 void setURL(java.net.URL url)
           
 boolean updateEntry(java.lang.String key, java.lang.String text, java.util.Map<java.lang.String,java.lang.String> metadata)
          Updates the specified key to have the specified text and metadata.
 ResourceBundleOperationResult updateEntryNoDialog(java.lang.String key, java.lang.String text, java.util.Map<java.lang.String,java.lang.String> metadata)
          Updates the specified key to have the specified text and metadata while not showing any dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.javatools.resourcebundle.ResourceBundleWrapper
findKeysByMetaData, findKeysByText, findKeysLikeKey, findKeysLikeText, getMetadata, keySet
 

Field Detail

_parent

protected ResourceBundleWrapperRT _parent
Constructor Detail

ResourceBundleWrapperRT

public ResourceBundleWrapperRT()
Method Detail

setURL

public void setURL(java.net.URL url)

setBundleId

public void setBundleId(java.lang.String bundleId)
Description copied from interface: ResourceBundleWrapper
Sets the bundleId associated with this instance of ResourceBundleWrapper

Specified by:
setBundleId in interface ResourceBundleWrapper
Parameters:
bundleId - the id of the bundle

getBundleId

public java.lang.String getBundleId()
Description copied from interface: ResourceBundleWrapper
Gets the bundleId associated with this instance of ResourceBundleWrapper

Specified by:
getBundleId in interface ResourceBundleWrapper
Returns:
the bundleId

parse

protected abstract void parse(java.net.URL url)

getKeyValueMap

public abstract java.util.Map<java.lang.String,java.lang.String> getKeyValueMap()
Gets the map of key-values for this bundle. This map will not include keys from related bundles in the language hierarchy. For that call getChainedKeyValueMap() instead. For example, if bundleA is requested in the Locale.US then the related bundles would be bundleA_en_US, bundleA_en, bundleA

Returns:
map of key/values

findKeys

protected java.util.Set<java.lang.String> findKeys(ResourceBundleWrapperRT.SearchType searchType,
                                                   java.lang.Object searchConstraint)
Returns a set of keys that satisfy the search

Parameters:
searchType - one of the valid search types
searchConstraint - a text string or a map of strings if a metadata search
keyMap - a map containing keys and the associated values
Returns:
a set of keys that satisfy the search or null if none found

setKeyGenerator

public void setKeyGenerator(ResourceBundleKeyGenerator generator)
Description copied from interface: ResourceBundleWrapper
Sets the key generator to use when using an automatic key name from ResourceBundleWrapper.addEntry(String,Map).

Specified by:
setKeyGenerator in interface ResourceBundleWrapper
Parameters:
generator - The ResourceBundleKeyGenerator to use. if generator is null, then the default key generator will be used.

getKeyGenerator

public ResourceBundleKeyGenerator getKeyGenerator()
Description copied from interface: ResourceBundleWrapper
Gets the key generator to use for making an automatic key name

Specified by:
getKeyGenerator in interface ResourceBundleWrapper
Returns:
the {@link ResourceBundleKeyGenerator) to use. May return null

setParentList

public void setParentList(java.util.List<java.lang.String> parentList)

getString

public java.lang.String getString(java.lang.String key)
Description copied from interface: ResourceBundleWrapper
Gets the translated text (value) identified by key

Specified by:
getString in interface ResourceBundleWrapper
Parameters:
key - The key in the resource bundle
Returns:
The translated text.

getMetadataFromParentChain

protected java.util.Map<java.lang.String,java.lang.String> getMetadataFromParentChain(java.lang.String key)

getChainedKeyValueMap

public java.util.Map<java.lang.String,java.lang.String> getChainedKeyValueMap()
Gets the key-value map for the bundle chained with any parent bundles For example, if the bundle is for BundleA_en_US the parent chain will include BundleA_en and Bundle

Returns:
a map of the keys and values

getParent

protected ResourceBundleWrapperRT getParent()

getParentChain

public java.util.List<ResourceBundleWrapperRT> getParentChain()

getParentList

protected java.util.List<java.lang.String> getParentList()

addEntry

public boolean addEntry(java.lang.String key,
                        java.lang.String text,
                        java.util.Map<java.lang.String,java.lang.String> metadata)
Description copied from interface: ResourceBundleWrapper
Adds a new entry (key, value, and optional metadata) into the resource bundle. May show a dialog if the key is being written into an "override" bundle and the warning dialog's "Don't show me this next time" checkbox has not been previously checked.

Specified by:
addEntry in interface ResourceBundleWrapper
Parameters:
key - The key name to use in the resource bundle.
text - The text to be translated.
metadata - Any associated metadata about the translation string This parameter may be null
Returns:
true on success

addEntryNoDialog

public ResourceBundleOperationResult addEntryNoDialog(java.lang.String key,
                                                      java.lang.String text,
                                                      java.util.Map<java.lang.String,java.lang.String> metadata)
Description copied from interface: ResourceBundleWrapper
Adds a new entry (key, value, and optional metadata) into the resource bundle. May show a dialog if the key is being written into an "override" bundle and the warning dialog's "Don't show me this next time" checkbox has not been previously checked.

Specified by:
addEntryNoDialog in interface ResourceBundleWrapper
Parameters:
key - The key name to use in the resource bundle.
text - The text to be translated.
metadata - Any associated metadata about the translation string This parameter may be null
Returns:
a result object that contains an indicator of whether the operation succeeded and may contain a string of any warning or error message

addEntry

public java.lang.String addEntry(java.lang.String text,
                                 java.util.Map<java.lang.String,java.lang.String> metadata)
Description copied from interface: ResourceBundleWrapper
Adds a new entry (value, and optional metadata) into the resource bundle and returns an automatically generated resource bundle key.

Specified by:
addEntry in interface ResourceBundleWrapper
Parameters:
text - The text to be translated.
metadata - Any associated metadata about the translation string. This parameter may be null
Returns:
the automatically generated key name

deleteEntry

public boolean deleteEntry(java.lang.String key)
Description copied from interface: ResourceBundleWrapper
Deletes the resource bundle entry identified by key. If key does not exist, then a value of false is returned.

Specified by:
deleteEntry in interface ResourceBundleWrapper
Parameters:
key - The key to delete
Returns:
true If the key is found and deleted success.

updateEntry

public boolean updateEntry(java.lang.String key,
                           java.lang.String text,
                           java.util.Map<java.lang.String,java.lang.String> metadata)
Description copied from interface: ResourceBundleWrapper
Updates the specified key to have the specified text and metadata. Shows a dialog to warn the user that a key is being updated (the dialog may be suppressed if it's "Don't show this again" checkbox has been checked.

Specified by:
updateEntry in interface ResourceBundleWrapper
Parameters:
key - The key to update
text - The new text for the given key
metadata - Any metadata to change. Existing metadata is merged with the new metadata, unless there is a key with a null value, then the existing metadata for that key is removed. If metadata is null then the existing metadata will be unchanged.
Returns:
true on success

updateEntryNoDialog

public ResourceBundleOperationResult updateEntryNoDialog(java.lang.String key,
                                                         java.lang.String text,
                                                         java.util.Map<java.lang.String,java.lang.String> metadata)
Description copied from interface: ResourceBundleWrapper
Updates the specified key to have the specified text and metadata while not showing any dialog

Specified by:
updateEntryNoDialog in interface ResourceBundleWrapper
Parameters:
key - The key to update
text - The new text for the given key
metadata - Any metadata to change. Existing metadata is merged with the new metadata, unless there is a key with a null value, then the existing metadata for that key is removed. If metadata is null then the existing metadata will be unchanged.
Returns:
a result object that contains an indicator of whether the operation succeeded and may contain a string of any warning or error message

addResourceBundleListener

public void addResourceBundleListener(ResourceBundleListener listener)
Description copied from interface: ResourceBundleWrapper
Registers a listenerto receive ResourceBundleEvents when the contents of the resource bundle change.

Specified by:
addResourceBundleListener in interface ResourceBundleWrapper
Parameters:
listener - the ResourceBundleListenerto register
See Also:
ResourceBundleListener, ResourceBundleEvent

removeResourceBundleListener

public void removeResourceBundleListener(ResourceBundleListener listener)
Description copied from interface: ResourceBundleWrapper
Removes a listenerthat received ResourceBundleEvents.

Specified by:
removeResourceBundleListener in interface ResourceBundleWrapper
Parameters:
listener - the ResourceBundleListenerto remove
See Also:
ResourceBundleListener, ResourceBundleEvent

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

E13403-03

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