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

E13403-02

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
 
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, java.util.Map keyMap)
          Returns a set of keys that satisfy the search
 java.lang.String getBundleId()
          Gets the bundleId associated with this instance of ResourceBundleWrapper
 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()
           
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 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, getString, keySet
 

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()

findKeys

protected java.util.Set<java.lang.String> findKeys(ResourceBundleWrapperRT.SearchType searchType,
                                                   java.lang.Object searchConstraint,
                                                   java.util.Map keyMap)
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

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

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

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

E13403-02

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