That would work, but his original e-mail indicated he
didn't want to turn off all access checking.
Pablo Jim=E9nez wrote:
> use this property in registry:
> python.security.respectJavaAccessibility =3D false
>=20
>=20
>=20
> -----Mensaje original-----
> De: jython-users-admin@...
> [mailto:jython-users-admin@... nombre de Jeff
> Emanuel
> Enviado el: mi=E9rcoles, 02 de febrero de 2005 22:42
> Para: Luke Kanies; Jython User
> Asunto: Re: [Jython-users] Accessing a java package-private method
>=20
>=20
> Use reflection, Luke. The key is setting the accessibility flag.
> If you are running with a SecurityManager, you might not be able
> to do this.
>=20
>=20
> theMethod=3DtheClass.getDeclaredMethod("methodName",argumentTypeList)
> theMethod.accessible=3D1
> theMethod.invoke(theObject,argumentValueList)
>=20
>=20
> Luke Kanies wrote:
>=20
>>Hi all,
>>
>>I've got a java class that my company wrote, and I've been largely
>>successful in accessing it from jython. I've recently come up against =
a
>>problem that apparently is solvable but I can't find a way to do so.
>>
>>I need to access a package-private method. I can't seem to find a way
>>to just say, "hey, import this method", without turning off all java
>>access checks. So, I figured I needed to be within the package in jyth=
on.
>>
>>I've tried building the same path for my jython code, so that when I
>>import 'path.to.class' I get both the jython and java code, and althoug=
h
>>it appears to load (dir() shows the __name__ attribute), I can't get
>>access to the class defined in it.
>>
>>Is there some example code out there of doing this? Basically, what I'=
m
>>trying to do is define a jython class inside an existing java package. =
I
>>have seen lots of example code on loading unrelated classes, but I need
>>to load a package from both jython and java.
>>
>>Thanks.
>>
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Jython-users mailing list
> Jython-users@...
> https://lists.sourceforge.net/lists/listinfo/jython-users
>=20
|