I have a java program that opens, reads, and write multiple files. it also contains complex logic formatting.
Now I wrote on jsfiddle an easy javascript here to do some tree traversals and parsing for me, and it is much easier than implement in Java.
My challenge now is how can i “embed” this Javascript script into my Java method. I’m primarily a Java coder.
The pseudocode for the Java method is something like this:
<Java method begins……>
String input = “ABC” //its more complex than ABC
String o1= null;
//JavaScript script begins,
//Javascript evaluates the Java string input
//Javascript output is assigned to Java o1
o1 = output;
//Javascript script ends
//maniputate and process Java string o1 - which is not null
<Java method ends>