This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Groovy and the fly likes Java + Groovy variable binding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Java + Groovy variable binding" Watch "Java + Groovy variable binding" New topic
Author

Java + Groovy variable binding

matej spac
Greenhorn

Joined: Apr 21, 2011
Posts: 28
Hi,
I am trying to embbed Groovy in Java app.
I know that through Binding object I can bind variables from Java app to Groovy script and use it in script. In my app I am trying to change value of Java variable with Groovy script and it works well:

My question is: is there some way to make java variables updates immediately after shell.evaluate() method calling? For example, if I would have 1000 variables i don't want call for every variable

because of one variable change in script code. Is it possible to ommit this step and update java variables with new value automatically?

|OCPJP 6|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java + Groovy variable binding
 
Similar Threads
Referencing a public variable...
HowTo --> GroovyShell().evaluate("['item1', 'item2', 'item3']")
Boolean value not changing
GroovyShell wait?
how to accept an instance of a class as a parameter