Elegant in its simplicity. I'm smacking my head. :-)

I tried it and I get the following error, I think because the method on the companion object is a static method?

>>> companionObj = Class.forName("com.mystuff.ProjectDAO$")

>>> companionObj.findAll()

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

TypeError: findAll(): expected 1 args; got 0

>>> companionObj.findAll

<java function findAll 0x5>






On Wed, Jul 9, 2014 at 1:31 PM, Jeff Emanuel <jemanuel@frii.com> wrote:

How about calling java.lang.Class.forName to get the class?

theCompanionClass = java.lang.Class.forName("whatever$");
theCompanionClass.doSomething()



On 7/9/2014 10:42 AM, Surendranauth Hiraman wrote:
Anyone have any experience calling a Scala companion object from Jython?

I have no problem calling a Scala class.

But because companion objects (holders for static methods) are actually a separate generated class with the '$' character at the end of the name, I'm having trouble accessing/importing them.

I guess the general problem would be how to access a class with the '$' in its name.

I wanted to confirm with folks more knowledgeable than me whether this can be done.

Thanks!

                                                            
SUREN HIRAMAN, VP TECHNOLOGY
Velos
Accelerating Machine Learning

440 NINTH AVENUE, 11TH FLOOR
NEW YORK, NY 10001
O: (917) 525-2466 ext. 105


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft


_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users




--
                                                            
SUREN HIRAMAN, VP TECHNOLOGY
Velos
Accelerating Machine Learning

440 NINTH AVENUE, 11TH FLOOR
NEW YORK, NY 10001
O: (917) 525-2466 ext. 105
F: 646.349.4063
E: suren.hiraman@velos.io
W: www.velos.io