Check for a java object type from python
I have 2 java classes Foo and FooBar under some package. Both these
classes implement interface FooIFC. I want to find if the instance of the
interface is of type Foo or FooBar from a python(Jython) script.
I have a static getinstance() in one of the base class(implementors) of IFC
from package import FooIFC
from package import Foo
if FooIFC.getinstance() instanceof Foo:
print "Foo"
else:
print "FooBar"
I also tried isintance(FooIFC.getinstance(), Foo) as well . Which give an
error name not found.
instanceof give expecting colon error .
How do I find the object type from a python script ?
Thanks
No comments:
Post a Comment