Java 1.5 api for ResourceBundle
getObject
public final Object getObject(String key)
Parameters:
key - the key for the desired object
Returns:
the object for the given key
Throws:
NullPointerException - if key is null
MissingResourceException - if no object for the given key can be found
@Ernest Friedman-Hill ---->
I have pasted the entire code for ResourceBundle.Please see it again.I have not missed it.i have imported java.util.ResourceBundle and used it in the below fashion
view plaincopy to clipboardprint?
resources = ResourceBundle.getBundle("Interpretor.MusicalNotes");
Hope it is clarified that the problem is not with resourceBundle.i have checked it.
For each candidate bundle name, it attempts to create a resource bundle:
First, it attempts to load a class using the candidate bundle name. If such a class can be found and loaded using the specified class loader, is assignment compatible with ResourceBundle, is accessible from ResourceBundle, and can be instantiated, getBundle creates a new instance of this class and uses it as the result resource bundle.
Otherwise, getBundle attempts to locate a property resource file. It generates a path name from the candidate bundle name by replacing all "." characters with "/" and appending the string ".properties". It attempts to find a "resource" with this name using ClassLoader.getResource. (Note that a "resource" in the sense of getResource has nothing to do with the contents of a resource bundle, it is just a container of data, such as a file.) If it finds a "resource", it attempts to create a new PropertyResourceBundle instance from its contents. If successful, this instance becomes the result resource bundle.
Deepak Lal wrote:Hi Campbell and Tony,
Could you please give me the syntax for extending to a resource Bundle.Since im new to generics i need some help on syntax.
Deepak Lal wrote:Could you please give me the syntax for extending to a resource Bundle.Since im new to generics i need some help on syntax.
Deepak Lal wrote:Hi,
Can you please tell me how to achieve it,i have gone through the API for List Resource Bundle.
In List Resource Bundle API ,There is no method to obtain a handle to properties file.
Deepak Lal wrote:Hi Tony,
Code Written as suggested by you With respect to LIST RESOURCE BUNDLE CLASS..
Deepak Lal wrote:
Need Help...whats wrong with the code now.I have implemented using List Resource Bundle.
Right! We're on it! Let's get to work tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|