unmarshaller = getJAXBUnmarshaller(context);
XMLStreamReader xsr = null;
if (type.isAnnotationPresent(XmlRootElement.class)) {
if (isBadgerFishConventionUsed) {
xsr = new BadgerFishXMLInputFactory().createXMLStreamReader(entityStream);
} else {
xsr =
new MappedXMLInputFactory(inputConfiguration)
.createXMLStreamReader(entityStream);
}
unmarshaledResource = unmarshaller.unmarshal(xsr);
} else {
if (isBadgerFishConventionUsed) {
xsr = new BadgerFishXMLInputFactory().createXMLStreamReader(entityStream);
} else {
xsr =
new MappedXMLInputFactory(inputConfiguration)
.createXMLStreamReader(entityStream);
}