Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
    @GET
    @Produces(MediaType.APPLICATION_ATOM_XML)
    public AtomFeed getFeed() {
        AtomFeed feed = new AtomFeed();
        feed.setId("http://example.com/atomfeed");
        feed.setTitle(new AtomText("Example"));
        feed.setUpdated(new Date());
        AtomLink link1 = new AtomLink();
        ...
            
        return feed;
    }
}

Consuming Atom Feed

...

Code Block
        @POST
    @Consumes(MediaType.APPLICATION_ATOM_XML)
    public void setFeed(AtomFeed feed) {
        ...
                
        return;
    }

Producing Atom Entry

...

Code Block
    @POST
    @Consumes(MediaType.APPLICATION_ATOM_XML)
    public void setEntry(AtomEntry entry) {
        ...
                
        return;
   }

Atom Providers

Apache Wink provides a set of entity providers that are capable of mapping Atom Feed and Atom Entry XML documents to and from an Atom data model.

Info
titleReference

Refer to chapter ‎9 TBD for more information on Data Models.

AtomFeedProvider

Handles reading and writing of the AtomFeedProvider class for the application/atom+xml media type.

 

Supported

Media Types

Entity

Read

Yes

application/atom+xml

AtomFeed

Write

Yes

application/atom+xml

AtomFeed

AtomFeedSyndFeedProvider

Handles reading and writing of the AtomFeedSyndFeedProvider class for the application/atom+xml media type.

 

Supported

Media Types

Entity

Read

Yes

application/atom+xml

SyndFeed

Write

Yes

application/atom+xml

SyndFeed

AtomFeedJAXBElementProvider

Handles reading and writing of the AtomFeedJAXBElementProvider class for the application/atom+xml media type.

 

Supported

Media Types

Entity

Read

Yes

application/atom+xml

JAXBElement<AtomFeed>

Write

Yes

application/atom+xml

JAXBElement<AtomFeed>

AtomEntryProvider

Handles reading and writing of the AtomEntryProvider class for the application/atom+xml media type.

 

Supported

Media Types

Entity

Read

Yes

application/atom+xml

AtomEntry

Write

Yes

application/atom+xml

AtomEntry

AtomEntrySyndEntryProvider

Handles reading and writing of the AtomEntrySyndEntryProvider class for the application/atom+xml media type.

 

Supported

Media Types

Entity

Read

Yes

application/atom+xml

SyndEntry

Write

Yes

application/atom+xml

SyndEntry

AtomEntryJAXBElementProvider

Handles reading and writing of the AtomEntryJAXBElementProvider class for the application/atom+xml media type.

 

Supported

Media Types

Entity

Read

Yes

application/atom+xml

JAXBElement<AtomEntry>

Write

Yes

application/atom+xml

JAXBElement<AtomEntry>

Atom Data Models

...