Package org.apache.wink.common.model.atom

Examples of org.apache.wink.common.model.atom.AtomFeed


                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream) throws IOException, WebApplicationException {
        AtomFeed feed = new AtomFeed((SyndFeed)t);
        super.writeTo(feed,
                      AtomFeed.class,
                      AtomFeed.class,
                      annotations,
                      mediaType,
View Full Code Here


                             Type genericType,
                             Annotation[] annotations,
                             MediaType mediaType,
                             MultivaluedMap<String, String> httpHeaders,
                             InputStream entityStream) throws IOException, WebApplicationException {
        AtomFeed feed =
            readFeed(AtomFeed.class, genericType, annotations, mediaType, httpHeaders, entityStream);
        return feed.toSynd(new SyndFeed());
    }
View Full Code Here

                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream) throws IOException, WebApplicationException {
        AtomFeed feed = new AtomFeed(t);
        writeFeed(feed,
                  AtomFeed.class,
                  genericType,
                  annotations,
                  mediaType,
View Full Code Here

                                          Annotation[] annotations,
                                          MediaType mediaType,
                                          MultivaluedMap<String, String> httpHeaders,
                                          InputStream entityStream) throws IOException,
        WebApplicationException {
        AtomFeed feed =
            readFeed(AtomFeed.class, genericType, annotations, mediaType, httpHeaders, entityStream);
        return atomObjectFactory.createFeed(feed);
    }
View Full Code Here

                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream) throws IOException, WebApplicationException {
        AtomFeed feed = t.getValue();
        writeFeed(feed,
                  AtomFeed.class,
                  genericType,
                  annotations,
                  mediaType,
View Full Code Here

                             MultivaluedMap<String, String> httpHeaders,
                             InputStream entityStream) throws IOException, WebApplicationException {

        MessageBodyReader<AtomFeed> reader =
            providers.getMessageBodyReader(AtomFeed.class, genericType, annotations, mediaType);
        AtomFeed feed =
            reader.readFrom(AtomFeed.class,
                            genericType,
                            annotations,
                            mediaType,
                            httpHeaders,
                            entityStream);
        return feed.toSynd(new SyndFeed());
    }
View Full Code Here

                        Type genericType,
                        Annotation[] annotations,
                        MediaType mediaType,
                        MultivaluedMap<String, Object> httpHeaders,
                        OutputStream entityStream) throws IOException, WebApplicationException {
        AtomFeed feed = new AtomFeed(t);
        MessageBodyWriter<AtomFeed> writer =
            providers.getMessageBodyWriter(AtomFeed.class, genericType, annotations, mediaType);
        writer.writeTo(feed,
                       AtomFeed.class,
                       genericType,
View Full Code Here

    private String diffFeed(String expectedFileName, String actual) throws Exception {
        InputStream expected = TestUtils.getResourceOfSamePackage(expectedFileName, getClass());

        // sort feeds
        AtomFeed expectedFeed = AtomFeed.unmarshal(new InputStreamReader(expected));
        AtomFeed actualFeed = AtomFeed.unmarshal(new StringReader(actual));
        Collections.sort(actualFeed.getEntries(), new AtomEntryComparator());
        Collections.sort(expectedFeed.getEntries(), new AtomEntryComparator());

        ByteArrayOutputStream actualOS = new ByteArrayOutputStream();
        ByteArrayOutputStream expectedOS = new ByteArrayOutputStream();
        AtomFeed.marshal(expectedFeed, expectedOS);
View Full Code Here

        Unmarshaller unmarshaller = AtomFeed.getUnmarshaller();
        InputStreamReader reader =
            new InputStreamReader(entityStream, ProviderUtils.getCharset(mediaType));
        Object object = AtomJAXBUtils.unmarshal(unmarshaller, reader);
        AtomFeed feed = null;
        if (object instanceof AtomFeed) {
            feed = (AtomFeed)object;
        } else {
            logger.error("request entity is not an atom feed (it was unmarshalled as {})", object
                .getClass());
View Full Code Here

    public static class Resource {

        @POST
        @Path("jaxbelement")
        public JAXBElement<AtomFeed> createWraped(JAXBElement<AtomFeed> feed) {
            AtomFeed atomFeed = new AtomFeed();
            atomFeed.setId(feed.getValue().getId());
            JAXBElement<AtomFeed> wrapedFeed = new ObjectFactory().createFeed(atomFeed);
            return wrapedFeed;
        }
View Full Code Here

TOP

Related Classes of org.apache.wink.common.model.atom.AtomFeed

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.