I want to convert string arrays with following structure:static String[] lines = {                          @1      var_decl         name: testStr  parent: @7,                                                               srcp: Auto.cpp:6                                 };into Java objects with following structure:class Token {   String type;   String name;   String source;   Token parent;}So far I'm parsing this in this way:Token parseLines(String[] lines) {    String[] firstElements = lines[0].split( );    String[] secondElements = lines[1].split( );    Token newToken = new Token();    newToken.type = firstElements[6];    newToken.name = firstElements[16];    String parentName = firstElements[19];    newToken.parent = getParent(parent); // find parent by name    newToken.source = secondElements[26];    return newToken;}As you can see, this is far from elegant. How can I improve this?
Parsing objects from complex String in Java
java;parsing