|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.jersey.atom.abdera.ContentHelper
public class ContentHelper
Helper class to assist in serializing and deserializing Java entities
as XML that will be transferred through the content element
of an Atom Entry instance. A configured instance of this
class can be made available in a resource class as follows:
@Context private ContentHelper contentHelper;
| Constructor Summary | |
|---|---|
ContentHelper(javax.ws.rs.ext.Providers providers)
Construct a configured instance of this helper. |
|
| Method Summary | ||
|---|---|---|
|
getContentEntity(org.apache.abdera.model.Entry entry,
java.lang.Class<T> clazz)
Deserialize the content element of the specified entry, and transform it back into an appropriate Java object. |
|
|
getContentEntity(org.apache.abdera.model.Entry entry,
javax.ws.rs.core.MediaType mediaType,
java.lang.Class<T> clazz)
Deserialize the content element of the specified entry, and transform it back into an appropriate Java object. |
|
void |
setContentEntity(org.apache.abdera.model.Entry entry,
javax.ws.rs.core.MediaType mediaType,
java.lang.Object entity)
Serialize the specified entity as the content element
of the specified entry. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContentHelper(javax.ws.rs.ext.Providers providers)
Construct a configured instance of this helper.
providers - Providers for this application| Method Detail |
|---|
public <T> T getContentEntity(org.apache.abdera.model.Entry entry,
java.lang.Class<T> clazz)
Deserialize the content element of the specified entry, and
transform it back into an appropriate Java object. The media type
used for selecting an appropriate Provider will be
acquired from the type attribute of the content
element.
entry - Entry whose content element is to be processedclazz - Class of the object to be returned
java.lang.IllegalArgumentException - if the specified entry does not
contain a valid content element
public <T> T getContentEntity(org.apache.abdera.model.Entry entry,
javax.ws.rs.core.MediaType mediaType,
java.lang.Class<T> clazz)
Deserialize the content element of the specified entry, and transform it back into an appropriate Java object.
entry - Entry whose content element is to be processedmediaType - MediaType to use when selecting an
appropriate providerclazz - Class of the object to be returned
java.lang.IllegalArgumentException - if the specified entry does not
contain a valid content element
public void setContentEntity(org.apache.abdera.model.Entry entry,
javax.ws.rs.core.MediaType mediaType,
java.lang.Object entity)
Serialize the specified entity as the content element
of the specified entry. The selected provider MUST
produce an XML representation.
entry - Entry whose content element is to be setmediaType - MediaType to pass as the type
attribute of the content element (also used to select an
appropriate Provider)entity - Entity to be serialized
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||