File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Groovy and the fly likes HowTo --> GroovyShell().evaluate( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "HowTo --> GroovyShell().evaluate("[ Watch "HowTo --> GroovyShell().evaluate("[ New topic

HowTo --> GroovyShell().evaluate("['item1', 'item2', 'item3']")

John Dee

Joined: May 13, 2010
Posts: 3

Would someone happen to know how to take a List or Map defined as a String (i.e. read off an InputStream) and assign the contents of that string to a List/Map object.

Something like GroovyShell().evaluate("[name:'nameVale', phone:'phoneVal', zip:'zipVal']"), but this does not work. I get the following error message:

No signature of method: com....GroovyShell() is applicable for argument types: () values: []

Craig Treptow

Joined: Oct 29, 2007
Posts: 16
This looks helpful:

Stack Overflow - Best Way To Code This
I agree. Here's the link:
subject: HowTo --> GroovyShell().evaluate("['item1', 'item2', 'item3']")
It's not a secret anymore!