Skip navigation links

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

E13403-10


oracle.javatools.resourcebundle
Interface ResourceBundleWrapper

All Known Implementing Classes:
NodeResourceBundle, ResourceBundleAdapter, ResourceBundleWrapperRT

public interface ResourceBundleWrapper

Run-time and Design-time interface which abstracts the resource bundle storage.


Nested Class Summary
static class ResourceBundleWrapper.KeyInfo
           

 

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.
 java.util.Set<java.lang.String> findKeysByMetaData(java.util.Map<java.lang.String,java.lang.String> metadata)
           
 java.util.Set<java.lang.String> findKeysByText(java.lang.String text)
           
 java.util.Set<java.lang.String> findKeysLikeKey(java.lang.String key)
           
 java.util.Set<java.lang.String> findKeysLikeText(java.lang.String text)
           
 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
 java.util.Map<java.lang.String,java.lang.String> getMetadata(java.lang.String key)
          Gets the translated text (value) identified by key
 java.lang.String getString(java.lang.String key)
          Gets the translated text (value) identified by key
 java.util.Set<java.lang.String> keySet()
          Returns a set view of the keys contained in this resource bundle.
 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 addEntry(String,Map).
 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

 

Method Detail

getString

java.lang.String getString(java.lang.String key)
Gets the translated text (value) identified by key
Parameters:
key - The key in the resource bundle
Returns:
The translated text.
Throws:
java.lang.NullPointerException - if the key is null
java.util.MissingResourceException - If the key not found in the resource bundle.

addEntry

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. 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.
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
Throws:
java.lang.NullPointerException - If key or text is null

addEntryNoDialog

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. 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.
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
Throws:
java.lang.NullPointerException - If key or text is null

addEntry

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.
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
Throws:
java.lang.NullPointerException - If text is null

deleteEntry

boolean deleteEntry(java.lang.String key)
Deletes the resource bundle entry identified by key. If key does not exist, then a value of false is returned.
Parameters:
key - The key to delete
Returns:
true If the key is found and deleted success.
Throws:
java.lang.NullPointerException - If key is null.

updateEntry

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. 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.
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
Throws:
java.lang.NullPointerException - If key or text is null.

updateEntryNoDialog

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
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
Throws:
java.lang.NullPointerException

findKeysLikeKey

java.util.Set<java.lang.String> findKeysLikeKey(java.lang.String key)
Parameters:
key - The substring key to match
Returns:
The Set of keys containing a match. If no keys match, then an empty Set is returned.
Throws:
java.lang.NullPointerException - If key is null.
See Also:
SearchSupport::findKeysLikeKey(String,boolean) Finds the {@link Set} of keys identifying entries whose key contains the substring {@code key}. No wildcards are expected or allowed.

findKeysByText

java.util.Set<java.lang.String> findKeysByText(java.lang.String text)
Parameters:
text - The exact text to match
Returns:
The Set of keys containing a match. If no keys match, then an empty Set is returned
Throws:
java.lang.NullPointerException - If text is null.
See Also:
SearchSupport::findKeysByText(String, boolean) Finds the {@link Set} of keys containing an exact match for {@code text}

findKeysLikeText

java.util.Set<java.lang.String> findKeysLikeText(java.lang.String text)
Parameters:
text - The substring text to match
Returns:
The Set of keys containing a match. If no keys match, then an empty Set is returned.
Throws:
java.lang.NullPointerException - If text is null.
See Also:
SearchSupport::findKeysLikeText(String, boolean) Finds the {@link Set} of keys identifying entries whose translated text contains the substring {@code text}. No wildcards are expected or allowed.

findKeysByMetaData

java.util.Set<java.lang.String> findKeysByMetaData(java.util.Map<java.lang.String,java.lang.String> metadata)
Parameters:
metadata - The metadata search criteria.
Returns:
The Set of keys containing a match. If no keys match, then an empty Set is returned.
See Also:
SearchSupport::findKeysByMetaData(Map, boolean), SearchSupport::findKeysLikeMetaData(Map, boolean) Gets a Set of keys which contain the specified metadata. Metadata Search Rules
Key Value Result
Key Value Result

addResourceBundleListener

void addResourceBundleListener(ResourceBundleListener listener)
Registers a listenerto receive ResourceBundleEvents when the contents of the resource bundle change.
Parameters:
listener - the ResourceBundleListenerto register
Throws:
java.lang.NullPointerException - If listeneris null.
See Also:
ResourceBundleListener, ResourceBundleEvent

removeResourceBundleListener

void removeResourceBundleListener(ResourceBundleListener listener)
Removes a listenerthat received ResourceBundleEvents.
Parameters:
listener - the ResourceBundleListenerto remove
Throws:
java.lang.NullPointerException - If listeneris null.
See Also:
ResourceBundleListener, ResourceBundleEvent

setKeyGenerator

void setKeyGenerator(ResourceBundleKeyGenerator generator)
Sets the key generator to use when using an automatic key name from addEntry(String,Map).
Parameters:
generator - The ResourceBundleKeyGenerator to use. if generator is null, then the default key generator will be used.

getKeyGenerator

ResourceBundleKeyGenerator getKeyGenerator()
Gets the key generator to use for making an automatic key name
Returns:
the {@link ResourceBundleKeyGenerator) to use. May return null

keySet

java.util.Set<java.lang.String> keySet()
Returns a set view of the keys contained in this resource bundle. This method provides a "read-only" view of the keys in this resource bundle. Any attempts to modify this Set, directly or through its Iterator will throw an UnsupportedOperationException.
Returns:
A set view of the keys in this resource bundle

getMetadata

java.util.Map<java.lang.String,java.lang.String> getMetadata(java.lang.String key)
Gets the translated text (value) identified by key
Parameters:
key - The key in the resource bundle
Returns:
The metadata
Throws:
java.lang.NullPointerException - if the key is null
java.util.MissingResourceException - If the key not found in the resource bundle.

getBundleId

java.lang.String getBundleId()
Gets the bundleId associated with this instance of ResourceBundleWrapper
Returns:
the bundleId

setBundleId

void setBundleId(java.lang.String bundleId)
Sets the bundleId associated with this instance of ResourceBundleWrapper
Parameters:
bundleId - the id of the bundle

Skip navigation links

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

E13403-10


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