The actual error you get is because you should write var str = ... instead of string.
You could get the substrings containing the function, and evaluate them as a function using eval. However this could lead to serious security and other concerns. To quote Douglas Crockford:
The eval function (and its relatives, Function, setTimeout, and setInterval) provide access to the JavaScript compiler. This is sometimes necessary, but in most cases it indicates the presence of extremely bad coding. The eval function is the most misused feature of JavaScript.
If you really want to go down this road, you can do it using eval, but you have been warned :)
By the way, if you have parsed your JSON you could do this:
obj[0].getConnectorPosition = eval(obj[0].getConnectorPosition);
So you replace the previous string with the evaluated method.