#323 Convenience JavaBeans Syntax for NameSpace.importObject

open
nobody
General (151)
5
2009-01-11
2009-01-11
Anonymous
No

Hello,
Bugs report for convenience syntax to access JavaBean properties as if they were fields for importStatic and importObject.
For example I have this class:
[code]
public class TestClass {
private int testVar;
public int getTestVar() { return testVar; }
public void setTestVar(int testVar) { this.testVar = testVar; }
}
[/code]
This script is working:
[script]
obj = new TestClass();
obj.testVar = 100;
print(obj.testVar);
[/script]

But for importObject it doesn't work:
[code]
Interpreter bsh = new Interpreter();
NameSpace ns = bsh.getNameSpace();
ns.importObject(new TestClass());
[/code]
The script:
[script]
setTestVar(100); // this is work
print(getTestVar()); // this is work

testVar = 100; // this is does not work
print(testVar); // this is does not work
[/script]
The same goes for NameSpace.importStatic(...)

Is there way around for this?

Thank you very much.

Related

Code: code

Discussion