Subj : Re: Creating java classes from javascript To : Jonathan Moss From : Igor Bukanov Date : Wed Apr 21 2004 03:41 pm See documentation for JavaScript Compiler, http://www.mozilla.org/rhino/jsc.html and ClassCompiler API it uses, http://lxr.mozilla.org/mozilla/source/js/rhino/src/org/mozilla/javascript/optimizer/ClassCompiler.java Regards, Igor Jonathan Moss wrote: > Is it possible to use Rhino as a pre-compiler. I would like to be able to > create a javascript defining a number of functions that can the be used to > create a java class. When instatiated the functions I defined are available > in java as normal java functions. > > Something like this > > The JavaScript :- > > function bob(arg){ > System.out.println(arg); > } > > --------------------------------------------------------- > Equivalent java source :- > > public class aClass(){ > > public void bob(String arg){ > System.out.println(arg); > } > > } > ---------------------------------------------------------- > java to use:- > > aClass a = new aClass(); > a.bob("a String"); > ---------------------------------------------------------- > > Is this possible? > > thanks > Jon > > > --- > Outgoing mail has been virus scanned > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.659 / Virus Database: 423 - Release Date: 15/Apr/2004 > > .