String to String array
I have a property file with the following content:
property1 = ["one","two","three"]
property2 = [ ["a","b","c" ], ["d","e"] ]
I want to convert this into java objects:
String[] property1;
String[][] property2;
How should I do this?
[481 byte] By [
me97esna] at [2007-11-26 18:52:44]

With recursive use of String.split(), I'd say. Will be brittle, though, because you have a potential problem with the unknown number of dimensions. You can't handle that dynamically.
I'm thinking about using java6 with jRuby. But I thought there might be a more dynamic way of doing it:
ScriptEngine rubyEngine = new ScriptEngineManager().getEngineByName("jruby");
Object object = rubyEngine.eval(theStringFromPropFile, rubyEngine.getContext());
RubyArray array = (RubyArray) object; // 2-d array
List<RubyArray> list = array.getList();
List<String> list1 = list.get(0).getList(); // String array
List<String> list2 = list.get(1).getList(); // String array