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

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


        }

        @POST
        @Path("xmlrootwithfactory")
        public AtomFeed createBare(AtomFeed feed) {
            AtomFeed atomFeed = new AtomFeed();
            atomFeed.setId(feed.getId());
            return atomFeed;
        }
View Full Code Here


        @POST
        @Path("jaxbelement")
        public List<JAXBElement<AtomFeed>> createWrapped(List<JAXBElement<AtomFeed>> feedList) {
            List<JAXBElement<AtomFeed>> wrappedFeeds = new ArrayList<JAXBElement<AtomFeed>>();
            for (JAXBElement<AtomFeed> feed : feedList) {
                AtomFeed atomFeed = new AtomFeed();
                atomFeed.setId(feed.getValue().getId() + 10);
                JAXBElement<AtomFeed> wrappedFeed = new ObjectFactory().createFeed(atomFeed);
                wrappedFeeds.add(wrappedFeed);
            }
            return wrappedFeeds;
        }
View Full Code Here

        @POST
        @Path("xmlrootwithfactorycollection")
        public List<AtomFeed> createBareCollection(List<AtomFeed> feedList) {
            List<AtomFeed> feeds = new ArrayList<AtomFeed>();
            for (AtomFeed feed : feedList) {
                AtomFeed atomFeed = new AtomFeed();
                atomFeed.setId(feed.getId() + 10);
                feeds.add(atomFeed);
            }
            return feeds;
        }
View Full Code Here

        @POST
        @Path("xmlrootwithfactoryarray")
        public AtomFeed[] createBareArray(AtomFeed[] feedList) {
            List<AtomFeed> feeds = new ArrayList<AtomFeed>();
            for (AtomFeed feed : feedList) {
                AtomFeed atomFeed = new AtomFeed();
                atomFeed.setId(feed.getId() + 10);
                feeds.add(atomFeed);
            }
            return feeds.toArray(new AtomFeed[] {});
        }
View Full Code Here

       
        String[] elements =
            getElementsFromList("<feeds>", "</feeds>", feedString, invoke.getContentAsString());
        assertEquals(4, elements.length);

        AtomFeed feed = null;
        for (int i = 1; i < elements.length; ++i) {
            feed =
                (AtomFeed)((JAXBElement<?>)unmarshallElement(AtomFeed.class, feedString + elements[i]))
                    .getValue();
            assertEquals("" + (i - 1) + "10", feed.getId());
        }
    }
View Full Code Here

        String[] elements =
            getElementsFromList("<feeds>", "</feeds>", feedString, invoke.getContentAsString());
        assertEquals(4, elements.length);

        AtomFeed feed = null;
        for (int i = 1; i < elements.length; ++i) {
            feed =
                (AtomFeed)((JAXBElement<?>)unmarshallElement(AtomFeed.class, feedString + elements[i]))
                    .getValue();
            assertEquals("" + (i - 1) + "10", feed.getId());
        }
    }
View Full Code Here

       
        String[] elements =
            getElementsFromList("<feeds>", "</feeds>", feedString, invoke.getContentAsString());
        assertEquals(4, elements.length);

        AtomFeed feed = null;
        for (int i = 1; i < elements.length; ++i) {
            feed =
                (AtomFeed)((JAXBElement<?>)unmarshallElement(AtomFeed.class, feedString + elements[i]))
                    .getValue();
            assertEquals("" + (i - 1) + "10", feed.getId());
        }
    }
View Full Code Here

            MessageBodyReader<AtomFeed> afp =
                providers.getMessageBodyReader(AtomFeed.class,
                                               AtomFeed.class,
                                               null,
                                               MediaType.APPLICATION_ATOM_XML_TYPE);
            AtomFeed entryToPost =
                afp.readFrom(AtomFeed.class,
                             null,
                             null,
                             MediaType.APPLICATION_ATOM_XML_TYPE,
                             null,
                             new ByteArrayInputStream(FEED.getBytes()));
            AtomFeed responseEntity =
                resource.accept(MediaType.APPLICATION_ATOM_XML_TYPE)
                    .contentType(MediaType.APPLICATION_ATOM_XML_TYPE).post(AtomFeed.class,
                                                                           entryToPost);

            ByteArrayOutputStream os = new ByteArrayOutputStream();
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);

        // already checked for non-null writer in isWriteable
       
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.