EMMA Coverage Report (generated Fri Jan 30 13:20:29 EST 2009)
[all classes][org.springframework.batch.item.support]

COVERAGE SUMMARY FOR SOURCE FILE [CompositeItemWriter.java]

nameclass, %method, %block, %line, %
CompositeItemWriter.java100% (1/1)60%  (3/5)45%  (21/47)50%  (6/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CompositeItemWriter100% (1/1)60%  (3/5)45%  (21/47)50%  (6/12)
clear (): void 0%   (0/1)0%   (0/13)0%   (0/3)
flush (): void 0%   (0/1)0%   (0/13)0%   (0/3)
CompositeItemWriter (): void 100% (1/1)100% (3/3)100% (1/1)
setDelegates (List): void 100% (1/1)100% (4/4)100% (2/2)
write (Object): void 100% (1/1)100% (14/14)100% (3/3)

1package org.springframework.batch.item.support;
2 
3import java.util.Iterator;
4import java.util.List;
5 
6import org.springframework.batch.item.ClearFailedException;
7import org.springframework.batch.item.FlushFailedException;
8import org.springframework.batch.item.ItemWriter;
9 
10/**
11 * Calls a collection of ItemWriters in fixed-order sequence.
12 * 
13 * The implementation is thread-safe if all delegates are thread-safe.
14 * 
15 * @author Robert Kasanicky
16 */
17public class CompositeItemWriter implements ItemWriter {
18 
19        private List delegates;
20 
21        public void setDelegates(List delegates) {
22                this.delegates = delegates;
23        }
24 
25        /**
26         * Calls injected ItemProcessors in order.
27         */
28        public void write(Object data) throws Exception {
29                for (Iterator iterator = delegates.listIterator(); iterator.hasNext();) {
30                        ((ItemWriter) iterator.next()).write(data);
31                }
32        }
33 
34        public void clear() throws ClearFailedException {
35                for (Iterator iterator = delegates.listIterator(); iterator.hasNext();) {
36                        ((ItemWriter) iterator.next()).clear();
37                }
38        }
39 
40        public void flush() throws FlushFailedException {
41                for (Iterator iterator = delegates.listIterator(); iterator.hasNext();) {
42                        ((ItemWriter) iterator.next()).flush();
43                }
44        }
45 
46}

[all classes][org.springframework.batch.item.support]
EMMA 2.0.5312 (C) Vladimir Roubtsov