Linq foreach java collection cannot access public method

I am studing aspose.words linq, I have a word template looks like below. where clients is “List<Client>” instance。
<<foreach [c in clients]>><<[c.getName()]>><>

but this is not work,the error is " An error has been encountered at the end of expression ‘c.getName()]>’. Can not resolve method ‘getName’ on type ‘class java.lang.Object’."

I know the java will erase types of collections. but i still want to ask ,is there any other way can achieve the goals like the template upper.

@xionghs

Please make sure that your template document and data source is correct. We suggest you please read the following article.

If you still face problem, please attach the following resources here for testing:

  • Your input Word document.
  • Please create a simple Java application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.