how to get a list of properties.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to get a list of properties.

beanshell
how can I get a "reflective" list of the current properties of an object?
the "methods" return a list of methods, but there's no equivalent for
"properties"
e.g.:

myobj() {
  a=1;
  b=2;

  aaa() { return a; }
  return this;
}

x=myobj();

print (x.methods); //show aaa


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: how to get a list of properties.

Daniel Wunsch
On Thursday 04 August 2005 12:20, [hidden email] wrote:
> how can I get a "reflective" list of the current properties of an object?

BeanShell 2.0b4 - by Pat Niemeyer ([hidden email])
bsh % foo() { var a = 1; return this; }
bsh % var f = foo();
bsh % print(f.namespace.VariableNames);
java.lang.String []: {
a,
}



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users