May I create an entry whose value is not string, such as icon, xml, or other objects??
int myIntegers = (int) myResources.getObject("intList");
The plugin purpose is to create ResourceBundle out of *.properties files. In which case, only strings are supported.
I suppose nothing prevents you from subclassing ResourceBundle yourself to have it return something else, but you would not be able to use the plugin with this approach.
Another alternative is to store string pointers to your binary files (e.g. icons) as opposed to the file itself. For instance, you can store the image path as strings. You can easily create some sort of utility class, that given a resource bundle key, returns an icon for the proper locale. Same with objects (e.g. arrays): you can have utility methods that parses your strings and creates whatever desired output.
A resource bundle made out of *.properties files does not know what you intent to do with those strings. I am afraid if you want it to return something else, you will have to come up with your own solution for that.
As far as XML goes, you should be able to put XML in *.properties files (being string).
This answers your question?
Thanks for you reply. Actually, We are going to find a Resource Editor for our users who have a little computer knowledges.
Log in to post a comment.