fortesinformatica/jasper-rails — pull request #13 by gregoriokusowski (2012-11-20 11:37:50+00:00)
Title: Accepting java parameters on controllers without conversion to java.lang.String

By checking the parent of each instance variable class on the controller, we can
be sure if it's a Rjb::Rjb_JavaClass or Rjb::Rjb_JavaProxy instance.
Example cases like Rjb::Java_lang_String or Rjb::Java_util_HashMap will also be
as they are.
I'm not sure if we can receive a Rjb::Rjb_JavaBridge, but it will work too.

The example present on the specs shows how java parameters can be used.

```ruby
title = (Rjb::import 'java.lang.String').new("The Beatles")
@parameter_that_is_a_java_class = (Rjb::import 'java.util.HashMap').new
@parameter_that_is_a_java_class.put("title", title)
```

```xml

...
$P{parameter_that_is_a_java_class}.get("title")
```

I chose to not convert every Hash to a java.util.HashMap because it can grow up easily if we use a recursive approach. I'll add later a snippet to the wiki or readme with a simple conversion tool.
Improvements and suggestions will be appreciated.