Rhino provides Scriptable interface and ScriptableObject helper class to implement a javascript object backed by a java object.
When ScriptableObject is constructed, its methods with names starting with jsFunction___, jsStaticFunction___, jsGet___, jsSet___, jsConstructor are automatically defined for the javascript object. This way you can defined funations, static frunctions, instance properties (by its accessors), and constructor.
The question is how to define static properties?
By static properties I mean properties on the constructor, like static methods are methods on the constructor.
The only way I see for now is to use finishInit method, and define static properties manually. But what is the right way?