Returning a list from a java action

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(; stringList.add(;
1 answers

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,