Subj : Re: Why don't we have "UnWrapFactory"? To : Andrei Tchijov From : Igor Bukanov Date : Fri Mar 11 2005 05:16 pm Andrei Tchijov wrote: > I am trying to implement JS interface to my company product. The > fact that it is possible to operate with native java objects/methods is > very handy ,but there is one problem. Bunch of our methods either > return Xml or accept Xml (When I say Xml I mean our own proprietary > implementation of org.w3c.Dom interfaces). What I would like to achive > is to instruct JS runtime to convert from "our" Xml to JS XML and vice > versa automagically. It looks like "our" Xml -> JS XML transformation > could be achieved with custom WrapFactory. So it should take care or > methods returning Xml. But I can not figure out if it is possible to > make JS convert JS XML -> "our" Xml when it needs to pass XML document > as a parameter to native java method. > Am I missing something? Your thoughts on the subject will be highly > appreciated. It is not possible with the current Rhino I suggest to file an enhancement report at http://bugzilla.mozilla.org/enter_bug.cgi?product=Rhino about it. Currently the conversion rules are hard coded in NativeJavaObject.java and there is no possibility to influence it. Those rules are complex due to deal with overloading as required by http://www.mozilla.org/js/liveconnect/lc3_method_overloading.html so ideas how to parametrize them with an interface are welcome. Regards, Igor .