I’ve got a properties file with two distinct key-value pair patters like the following;
- name.name.name.key = value
- name.name.fullname.key = value
Accessing them one by one is fine if the key is known.
What I need now, though, is to access ALL values from say name.name.name without knowing the keys (integers to be exact). The values then have to be added to an ArrayList to be displayed in a List.
The keys are completely random, so I don’t know the range beforehand (I can’t and don’t want to hardcode the range of range of keys for each single properties file), so simply looping through a previously defined range isn’t what I need here. Also, the keys are not successive.
How can I do this with AS3?
Just for clarification as this seems to be a little confusing;
I do not want to parse the properties file. I rather want to solve this using the methods AS and Flex already provide.
The ResourceBundle class already has a method that outputs the content of the specified bundle. However, it contains all values. What I need is just a subset of values that match a given key pattern.
Edit:
To make this easier, I can drop the key pattern matching and create a new resource file with a distinct pattern. Now I only need to get all key-value pairs (I need both the integers from the keys and the value) from that resource.
Here is a simple example with string parsing: