From: Satya G. <sg...@be...> - 2003-10-24 15:54:26
|
Hello I have a jython function: def getTargetArray(type, values): return javaObj.getTargetArray(type, values) The implementation of javaObj.getTargetArray(type,values) is something like this, CustomBean[] getTargetArray(String type, String values) { CustomBean[] result = new CustomBean[2]; String[] valuesArray = Utils.toArray(values); for (int i = 0; i < 2; i++) { result[i] = getCustomBean(type,valuesArray[i]); } return result; } when I call. >>> x = getTargetArray("myBean","myCustom") >>> fooBean.setCustomBeans(x) when I try to do this I get this error, Traceback (innermost last): File "<input>", line 1, in ? TypeError: setCustomBeans(): 1st arg can't be coerced to management.configuration.CustomBean[] Does any one how could I pass in a pyArray to my java bean's set method that takes a Object[] ? I looked at the jython's jarray module but wasn't able to figure out how to do this. Any pointers much appreciated, Thanks -satya |