2

In my projects I am accessing property strings using the Messages.KEY_NAME to get the value of the property keys.

Now I have to replace all those Messages.KEY_NAME into Properties.getString(KEY_NAME) function calls.

Is there any trick or shortcut in eclipse to do this?

I want to convert all field accessors of a particular class into function calls passing the field names as the input parameter.

There are more than 1000 properties with key names

Thanks in advance!

EDIT-1

The marked duplicate questions is about direct search and replace string in workspace. My question is about converting static field accessors into function calls where field name is the input string argument for the function.

Mohamed Iqzas
  • 976
  • 1
  • 14
  • 19
  • 1
    I'm not clear how you are currently get the property values for the keys? – Steve Smith Aug 11 '17 at 11:43
  • 2
    @Hugo That dupe answer does not help in this question. – Steve Smith Aug 11 '17 at 13:35
  • 2
    @ꜱᴜʀᴇꜱʜᴀᴛᴛᴀ That dupe answer does not help in this question. – Steve Smith Aug 11 '17 at 13:36
  • @SteveSmith : currently I am using eclipse externalise utility , which generates Messages class through which all the properties can be accessed as static constant variables. But I dont want that mechanism. but I want to retain the property files generated by eclipse. I will write a separate function to retrieve the properties from all those property files. Now I want to replace all the 'Messages.PROPERTY_NAME' to be replaced with 'myvariable.getValue(PROPERTY_NAME)' ... PROPERTY_NAME changes everywhere in the code for each property – Mohamed Iqzas Aug 16 '17 at 06:21
  • 1
    @Hugo as commented by steve, the marked question doesnt have solution for this question. Kindly remove the duplicate tag so that I can get a possible answer. – Mohamed Iqzas Aug 16 '17 at 06:29
  • You could try flagging it for moderator intervention, until @Hugo or whoever get round to unmarking it as a duplicate. I don't think they read the question properly, or didn't understand it. – Steve Smith Aug 16 '17 at 08:37
  • @SteveSmith sorry i dont know how to mark it for moderator intervention. i am not able to find any option for that. All I get is to edit the question. – Mohamed Iqzas Aug 17 '17 at 10:38

0 Answers0