SingleShot
SingleShot

Reputation: 19131

Spring Expression Language (SpEL) for Array Method Parameters

I have a Spring Integration project where I am trying to call a method on a bean that takes a String object and Class object as parameters. The class object I want to pass to it is Long[].class but I can't figure out the correct syntax. I've tried various combinations of the following to no avail:

expression="@parser.readValue(payload, T(java.lang.Long[]))"

For now I've simply wrapped the call in another java class (hardcoding the Class type) and call that via SpEL. What is the correct syntax for an array class parameter?

Upvotes: 4

Views: 3874

Answers (1)

Gary Russell
Gary Russell

Reputation: 174564

This works...

...(payload, new java.lang.Long[0].class)

Upvotes: 3

Related Questions