use of org.codehaus.jettison.badgerfish.BadgerFishXMLInputFactory in project cxf by apache.
the class BadgerFishProvider method readFrom.
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType m, MultivaluedMap<String, String> headers, InputStream is) {
try {
JAXBContext context = getJAXBContext(type);
Unmarshaller unmarshaller = context.createUnmarshaller();
BadgerFishXMLInputFactory factory = new BadgerFishXMLInputFactory();
XMLStreamReader xsw = factory.createXMLStreamReader(is);
Object obj = unmarshaller.unmarshal(xsw);
xsw.close();
return obj;
} catch (JAXBException e) {
e.printStackTrace();
} catch (XMLStreamException e) {
e.printStackTrace();
}
return null;
}
Aggregations