Announcement Announcement Module
Collapse
No announcement yet.
Overloading method "add" of Chunk Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Overloading method "add" of Chunk

    Hello

    I ran into an issue with the processing of collections in a CompositeItemProcessor, what bugs me is that I made a smoke test some time ago where I return a list of items which properly got written by a FlatFileItemWriter.

    I need to revisit that smoke test though to be sure.

    The issue I ran into is that if I return a list of items by the last processor the write method of the ItemWriter will not decompose the list since the list I returned in my processor is wrapped in another list by the SimpleChunkProcessor by the method:

    Code:
    70 
    71 	public void add(W item) {
    72 		items.add(item);
    73 	}
    I cannot foresee the side effects yet but I was wondering if it makes sense to overload the add method with;

    Code:
    public void add(Collection<? extends W> items){
                items.addAll(items);
    }
    For the time being I will extend FlatFileItemWriter and override the write method and decomposing the outer list if I get nested list structures as the output of my processor chain.

    Any comments appreciated.

    Best regards

  • #2
    Hello

    I am not sure why there was no response, I implemented my own workaround which dissasembles List of List structures if occured and calls the reader with the unpacked lists.
    But I am still wondering why this is not covered for a processor, I am surely missing something but would be happy if someone can shed some light on it.

    Thanks
    Tarik

    Comment

    Working...
    X