I'm wondering if it is somehow possible in Java (for Android in this specific case) to get from an ArrayList of strings a set of static, preferably final, variables stored in a resource class or enum, like aapt does for the resource class "R".
An example, if I have the following ArrayList:
ArrayList<String> AL=new ArrayList<String>();
AL.add("chat");
AL.add("greeting");
AL.add("conversation");
method_to_get_the_class(AL); //or something like this......
I'd like to get somewhere a static class like
static class ModeList {
public final static String CHAT="chat";
public final static String GREETING="greeting";
public final static String CONVERSATION="conversation";
}
Do you think it could be possible, maybe using some kind of build pre-processing method like Android's aapt? Maybe with Gradle (which I don't know very well)? The final target is to be able to recall each ArrayList entry by a variable named like its content, exactly like layout resources of Android.
Thanks