@ SuppressWarnings ( "rawtypes" ) public < T extends ODataEntity > ListResult < T > unmarshalFeed ( InputStream stream , Class < T > contentType ) throws JAXBException , ServiceException { validateNotNull ( stream , "stream" ) ; validateNotNull ( contentType , "contentType" ) ; List < T > entries = new ArrayList < T > ( ) ; FeedType feed = unmarshalFeed ( stream ) ; Class < ? > marshallingContentType = getMarshallingContentType ( contentType ) ; for ( Object feedChild : feed . getFeedChildren ( ) ) { EntryType entry = asEntry ( feedChild ) ; if ( entry != null ) { entries . add ( contentFromEntry ( contentType , marshallingContentType , entry ) ) ; } } return new ListResult < T > ( entries ) ; }
Given a stream that contains XML with an atom Feed element at the root unmarshal it into Java objects with the given content type in the entries .