0

Does Rhino have function convert its script to java source code? I want to convert Rhino script to java source code.

durron597
  • 31,968
  • 17
  • 99
  • 158
Kei Minagawa
  • 4,395
  • 3
  • 25
  • 43
  • You want a translator from JavaScript to Java? Where have you looked? – Bob Dalgleish Jan 05 '14 at 14:15
  • Why do you need that? – Philipp Jan 05 '14 at 19:59
  • Hi Bob and Philipp. I want to know what rhino do when runnig my script. In addition I think Java source code is more reliable than Rhino's(sorry it's no reason). So I want to convert Rhino source code to Java's. But it is too difficult for me to read and realize Rhino source code ,because my programming skill is very low and I think I don't need to realize all about Rhino. Thanks. – Kei Minagawa Jan 06 '14 at 11:56

1 Answers1

0

I think is not possible do that. You need to read the Rhino documentation and if you know a little bit of java you can do this.

but if you want to learn some code of rhino writing by other person you can do this when a few breakpoints.

Java:

public void CheckMe(Object obj) {
   // breakpoint here -> 
   System.out.println(obj);

}

Javascript or (Rhino file):

function doMe() {
   // here you can pass any object to java 
   javaInjectedContext.CheckMe(some_object); 

   // e.g.
   var hola = { "huup" : 202, mikaSp : "jjuu"};
   javaInjectedContext.CheckMe(hola);
}
doMe();

and when your are debuggin you will check each line.. the content of each object (like each step) so you can check class type or value, etc.

Pablo Pantaleon
  • 1,506
  • 1
  • 19
  • 38