How to use or escape java 8 Lambda expressions in

2019-05-11 20:10发布

问题:

I'm working on a Product (Sailpoint IdentityIQ that runs in Tomcat) which uses Beanshell env for product customization hooks. I want to write some code to parse a large csv file and want to leverage Java 8 Streams. But I'm facing issue with Beanshell env throwing errors and didn't recognize the Lambda expressions though we are using Java 8

Is there any way we can tell beanshell to recognize the lambdas or escape in the code

回答1:

Lambda expressions still not supported in beanshell

Lambdas are coming, rest assured! With the new approach of using Method Handles we are one step closer to utilise Lambda Meta Factory for creating function objects, unless we don't simply go the same route as with Java EL... we have options.