Returning a list from a java action

1
I am using a java action to replace some objects in a list.. I have been trying to convert the List to an IMendixObject, but no luck so far. Anyone help me out? how to return stringlist in below code? or add function is not work imendixobject?         String caption = "This is a #test caption with #multiple #hashtags"; Pattern pattern = Pattern.compile("#\\w+"); Matcher matcher = pattern.matcher(caption); List<String> stringList = new ArrayList<>(); while (matcher.find()) { System.out.println(matcher.group()); stringList.add(matcher.group());
asked
1 answers
0

Lists of primitives aren’t supported in Mendix. You can create a new non-persistent Entity with just a string attribute and create an object of that entity for each match. You can then return a list of those objects at the end of your java action.

 

However, are you sure that what you’re trying to achieve isn’t possible with string operations within Mendix? Specifically find, replace and/or substring?

 

Kind regards,

Luc

answered