Currently I have a complex DTO which has an array in it like that:
public class Dto {
private String somethingObject;
private List<String> arrayOfObjects;
}
I need to do a batch work on them, and I have the following file:
object | arrayItem1 arrayItem2 arrayItem3
I can use a LineTokenizer with a custom delimiter: "|" The problem is, that I can`t figure it out, how to recognize the fields in the array. I can change the structure of the input a little bit, it can be customized. I can change the List into Array as well, there is no restriction on that part.
The question is, that how can I force the ItemReader, that the arrayOfObjects is represented truly as a list with 3 elements, and not as a list with one long element like that : "arrayItem1 arrayItem2 arrayItem3"