|
||||||||||
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(Providers providers)
Construct a configured instance of this helper. |
Method Summary | ||
---|---|---|
|
getContentEntity(org.apache.abdera.model.Entry entry,
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,
MediaType mediaType,
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,
MediaType mediaType,
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(Providers providers)
Construct a configured instance of this helper.
providers
- Providers for this applicationMethod Detail |
---|
public <T> T getContentEntity(org.apache.abdera.model.Entry entry, 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
IllegalArgumentException
- if the specified entry does not
contain a valid content elementpublic <T> T getContentEntity(org.apache.abdera.model.Entry entry, MediaType mediaType, 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
IllegalArgumentException
- if the specified entry does not
contain a valid content elementpublic void setContentEntity(org.apache.abdera.model.Entry entry, MediaType mediaType, 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 |