EMMA Coverage Report (generated Tue May 06 07:28:24 PDT 2008)
[all classes][org.springframework.batch.item.xml.oxm]

COVERAGE SUMMARY FOR SOURCE FILE [UnmarshallingEventReaderDeserializer.java]

nameclass, %method, %block, %line, %
UnmarshallingEventReaderDeserializer.java100% (1/1)100% (2/2)100% (28/28)100% (10/10)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class UnmarshallingEventReaderDeserializer100% (1/1)100% (2/2)100% (28/28)100% (10/10)
UnmarshallingEventReaderDeserializer (Unmarshaller): void 100% (1/1)100% (8/8)100% (4/4)
deserializeFragment (XMLEventReader): Object 100% (1/1)100% (20/20)100% (6/6)

1package org.springframework.batch.item.xml.oxm;
2 
3import java.io.IOException;
4 
5import javax.xml.stream.XMLEventReader;
6 
7import org.springframework.batch.item.xml.EventReaderDeserializer;
8import org.springframework.dao.DataAccessResourceFailureException;
9import org.springframework.oxm.Unmarshaller;
10import org.springframework.util.Assert;
11import org.springframework.xml.transform.StaxSource;
12 
13/**
14 * Delegates deserializing to Spring OXM {@link Unmarshaller}.
15 *
16 * @author Robert Kasanicky
17 * @author Lucas Ward
18 */
19public class UnmarshallingEventReaderDeserializer implements EventReaderDeserializer {
20 
21        private Unmarshaller unmarshaller;
22 
23        public UnmarshallingEventReaderDeserializer(Unmarshaller unmarshaller){
24                Assert.notNull(unmarshaller);
25                this.unmarshaller = unmarshaller;
26        }
27 
28        public Object deserializeFragment(XMLEventReader eventReader) {
29                Object item = null;
30                try {
31                        item = unmarshaller.unmarshal(new StaxSource(eventReader));
32                }
33                catch (IOException e) {
34                        throw new DataAccessResourceFailureException("IO error during unmarshalling", e);
35                }
36                return item;
37        }
38}

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