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

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


        @GET
        @Path("atomfeed")
        @Produces("application/atom+xml")
        public AtomFeed getAtomFeed() throws IOException {
            AtomFeed feed = AtomFeed.unmarshal(new StringReader(FEED));
            return feed;
        }
View Full Code Here


        @GET
        @Path("atomfeedelement")
        @Produces("application/atom+xml")
        public JAXBElement<AtomFeed> getAtomFeedElement() throws IOException {
            AtomFeed feed = AtomFeed.unmarshal(new StringReader(FEED));
            org.apache.wink.common.model.atom.ObjectFactory of =
                new org.apache.wink.common.model.atom.ObjectFactory();
            return of.createFeed(feed);
        }
View Full Code Here

        @GET
        @Path("atomsyndfeed")
        @Produces("application/atom+xml")
        public SyndFeed getSyndFeed() throws IOException {
            AtomFeed feed = AtomFeed.unmarshal(new StringReader(FEED));
            return feed.toSynd(new SyndFeed());
        }
View Full Code Here

    public void testJAXBElementProviderReaderWriter() throws SecurityException,
        NoSuchFieldException {

        JAXBElementXmlProvider provider = new JAXBElementXmlProvider();
        AtomFeed af = new AtomFeed();
        org.apache.wink.common.model.atom.ObjectFactory objectFactory =
            new org.apache.wink.common.model.atom.ObjectFactory();
        JAXBElement<AtomFeed> feed = objectFactory.createFeed(af);
        Type genericType =
            JAXBElementProviderTest.class.getDeclaredField("atomfeed").getGenericType();
View Full Code Here

    }

    public void testJAXBXmlElementProviderReaderWriter() throws SecurityException,
        NoSuchFieldException {
        JAXBXmlProvider provider = new JAXBXmlProvider();
        AtomFeed af = new AtomFeed();

        assertTrue(provider.isWriteable(af.getClass(), null, null, new MediaType("text", "xml")));
        assertTrue(provider.isWriteable(af.getClass(), null, null, new MediaType("application",
                                                                                 "xml")));
        assertTrue(provider.isWriteable(af.getClass(), null, null, new MediaType("application",
                                                                                 "atom+xml")));
        assertTrue(provider.isWriteable(af.getClass(), null, null, new MediaType("application",
                                                                                 "atomsvc+xml")));
        assertFalse(provider.isWriteable(af.getClass(), null, null, new MediaType("text", "plain")));

        assertTrue(provider.isReadable(af.getClass(), null, null, new MediaType("text", "xml")));
        assertTrue(provider.isReadable(af.getClass(), null, null, new MediaType("application",
                                                                                "xml")));
        assertTrue(provider.isReadable(af.getClass(), null, null, new MediaType("application",
                                                                                "atom+xml")));
        assertTrue(provider.isReadable(af.getClass(), null, null, new MediaType("application",
                                                                                "atomsvc+xml")));
        assertFalse(provider.isReadable(af.getClass(), null, null, new MediaType("text", "plain")));
    }
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

        }

        @POST
        @Path("xmlrootwithfactory")
        public AtomFeed createBare(AtomFeed feed) {
            AtomFeed atomFeed = new AtomFeed();
            atomFeed.setId(feed.getId());
            return atomFeed;
        }
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.