Apache CXF API

org.apache.cxf.jaxrs.provider.atom
Class AtomPojoProvider

java.lang.Object
  extended by org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
      extended by org.apache.cxf.jaxrs.provider.atom.AtomPojoProvider
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<Object>, javax.ws.rs.ext.MessageBodyWriter<Object>

@Produces(value={"application/atom+xml","application/atom+xml;type=feed","application/atom+xml;type=entry"})
@Consumes(value={"application/atom+xml","application/atom+xml;type=feed","application/atom+xml;type=entry"})
@Provider
public class AtomPojoProvider
extends AbstractConfigurableProvider
implements javax.ws.rs.ext.MessageBodyWriter<Object>, javax.ws.rs.ext.MessageBodyReader<Object>


Constructor Summary
AtomPojoProvider()
           
 
Method Summary
protected  boolean buildEntry(org.apache.abdera.model.Entry entry, Object o, Class<?> pojoClass)
           
protected
<X> boolean
buildFeed(org.apache.abdera.model.Feed feed, X o, Class<?> pojoClass)
           
protected  void createEntryContent(org.apache.abdera.factory.Factory factory, org.apache.abdera.model.Entry e, Object o, Class<?> cls)
           
protected  org.apache.abdera.model.Entry createEntryFromObject(org.apache.abdera.factory.Factory factory, Object o, Class<?> cls)
           
protected  org.apache.abdera.model.Feed createFeedFromCollectionWrapper(org.apache.abdera.factory.Factory factory, Object o, Class<?> pojoClass)
           
protected  org.apache.abdera.writer.Writer createWriter(String writerName)
           
protected  AbstractAtomElementBuilder<?> getAtomBuilder(Class<?> pojoClass)
           
protected
<T> T
getAtomElementHandler(Map<String,T> handlers, Class<?> pojoClass)
           
protected  AtomElementReader<?,?> getAtomReader(Class<?> pojoClass)
           
protected  AtomElementWriter<?,?> getAtomWriter(Class<?> pojoClass)
           
 long getSize(Object t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
           
protected  boolean isFeedRequested(javax.ws.rs.core.MediaType mt)
           
 boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt)
           
 Object readFrom(Class<Object> cls, Type type, Annotation[] anns, javax.ws.rs.core.MediaType mt, javax.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is)
           
 void setAtomBuilders(Map<String,AbstractAtomElementBuilder<?>> builders)
           
 void setAtomClassBuilders(Map<Class<?>,AbstractAtomElementBuilder<?>> builders)
           
 void setAtomClassReaders(Map<Class<?>,AtomElementReader<?,?>> readers)
           
 void setAtomClassWriters(Map<Class<?>,AtomElementWriter<?,?>> writers)
           
 void setAtomReaders(Map<String,AtomElementReader<?,?>> readers)
           
 void setAtomWriters(Map<String,AtomElementWriter<?,?>> writers)
           
 void setAutodetectCharset(boolean autodetectCharset)
           
 void setCollectionGetters(Map<String,String> methods)
           
 void setCollectionSetters(Map<String,String> methods)
           
protected  void setEntryContent(org.apache.abdera.factory.Factory factory, org.apache.abdera.model.Entry e, String content)
           
 void setEntryContentMethodName(String name)
           
protected  void setEntryProperties(org.apache.abdera.factory.Factory factory, org.apache.abdera.model.Entry entry, Object o, Class<?> cls)
           
protected  void setFeedFromCollection(org.apache.abdera.factory.Factory factory, org.apache.abdera.model.Feed feed, Object wrapper, Class<?> wrapperCls, Object collection, Class<?> collectionCls, Type collectionType, boolean writerUsed)
           
protected  void setFeedProperties(org.apache.abdera.factory.Factory factory, org.apache.abdera.model.Feed feed, Object wrapper, Class<?> wrapperCls, Object collection, Class<?> collectionCls, Type collectionType)
           
 void setFormattedOutput(boolean formattedOutput)
           
 void setMessageContext(MessageContext context)
           
 void setUseJaxbForContent(boolean use)
           
protected  void tryInjectMessageContext(Object handler)
           
 void writeTo(Object o, Class<?> cls, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mt, javax.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream os)
           
 
Methods inherited from class org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
getBus, getConsumeMediaTypes, getEnableBuffering, getEnableStreaming, getProduceMediaTypes, init, isPayloadEmpty, isPayloadEmpty, setBus, setConsumeMediaTypes, setEnableBuffering, setEnableStreaming, setProduceMediaTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtomPojoProvider

public AtomPojoProvider()
Method Detail

setUseJaxbForContent

public void setUseJaxbForContent(boolean use)

setEntryContentMethodName

public void setEntryContentMethodName(String name)

setMessageContext

@Context
public void setMessageContext(MessageContext context)

tryInjectMessageContext

protected void tryInjectMessageContext(Object handler)

getSize

public long getSize(Object t,
                    Class<?> type,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mt)
Specified by:
getSize in interface javax.ws.rs.ext.MessageBodyWriter<Object>

setCollectionGetters

public void setCollectionGetters(Map<String,String> methods)

setCollectionSetters

public void setCollectionSetters(Map<String,String> methods)

isWriteable

public boolean isWriteable(Class<?> type,
                           Type genericType,
                           Annotation[] annotations,
                           javax.ws.rs.core.MediaType mt)
Specified by:
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<Object>

writeTo

public void writeTo(Object o,
                    Class<?> cls,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mt,
                    javax.ws.rs.core.MultivaluedMap<String,Object> headers,
                    OutputStream os)
             throws IOException
Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<Object>
Throws:
IOException

createWriter

protected org.apache.abdera.writer.Writer createWriter(String writerName)

setFormattedOutput

public void setFormattedOutput(boolean formattedOutput)

createFeedFromCollectionWrapper

protected org.apache.abdera.model.Feed createFeedFromCollectionWrapper(org.apache.abdera.factory.Factory factory,
                                                                       Object o,
                                                                       Class<?> pojoClass)
                                                                throws Exception
Throws:
Exception

buildFeed

protected <X> boolean buildFeed(org.apache.abdera.model.Feed feed,
                                X o,
                                Class<?> pojoClass)

getAtomWriter

protected AtomElementWriter<?,?> getAtomWriter(Class<?> pojoClass)

getAtomReader

protected AtomElementReader<?,?> getAtomReader(Class<?> pojoClass)

getAtomElementHandler

protected <T> T getAtomElementHandler(Map<String,T> handlers,
                                      Class<?> pojoClass)

setFeedFromCollection

protected void setFeedFromCollection(org.apache.abdera.factory.Factory factory,
                                     org.apache.abdera.model.Feed feed,
                                     Object wrapper,
                                     Class<?> wrapperCls,
                                     Object collection,
                                     Class<?> collectionCls,
                                     Type collectionType,
                                     boolean writerUsed)
                              throws Exception
Throws:
Exception

getAtomBuilder

protected AbstractAtomElementBuilder<?> getAtomBuilder(Class<?> pojoClass)

setFeedProperties

protected void setFeedProperties(org.apache.abdera.factory.Factory factory,
                                 org.apache.abdera.model.Feed feed,
                                 Object wrapper,
                                 Class<?> wrapperCls,
                                 Object collection,
                                 Class<?> collectionCls,
                                 Type collectionType)

createEntryFromObject

protected org.apache.abdera.model.Entry createEntryFromObject(org.apache.abdera.factory.Factory factory,
                                                              Object o,
                                                              Class<?> cls)
                                                       throws Exception
Throws:
Exception

buildEntry

protected boolean buildEntry(org.apache.abdera.model.Entry entry,
                             Object o,
                             Class<?> pojoClass)

createEntryContent

protected void createEntryContent(org.apache.abdera.factory.Factory factory,
                                  org.apache.abdera.model.Entry e,
                                  Object o,
                                  Class<?> cls)
                           throws Exception
Throws:
Exception

setEntryContent

protected void setEntryContent(org.apache.abdera.factory.Factory factory,
                               org.apache.abdera.model.Entry e,
                               String content)

setEntryProperties

protected void setEntryProperties(org.apache.abdera.factory.Factory factory,
                                  org.apache.abdera.model.Entry entry,
                                  Object o,
                                  Class<?> cls)

isFeedRequested

protected boolean isFeedRequested(javax.ws.rs.core.MediaType mt)

setAtomWriters

public void setAtomWriters(Map<String,AtomElementWriter<?,?>> writers)

setAtomReaders

public void setAtomReaders(Map<String,AtomElementReader<?,?>> readers)

setAtomBuilders

public void setAtomBuilders(Map<String,AbstractAtomElementBuilder<?>> builders)

setAtomClassWriters

public void setAtomClassWriters(Map<Class<?>,AtomElementWriter<?,?>> writers)

setAtomClassReaders

public void setAtomClassReaders(Map<Class<?>,AtomElementReader<?,?>> readers)

setAtomClassBuilders

public void setAtomClassBuilders(Map<Class<?>,AbstractAtomElementBuilder<?>> builders)

isReadable

public boolean isReadable(Class<?> type,
                          Type genericType,
                          Annotation[] annotations,
                          javax.ws.rs.core.MediaType mediaType)
Specified by:
isReadable in interface javax.ws.rs.ext.MessageBodyReader<Object>

readFrom

public Object readFrom(Class<Object> cls,
                       Type type,
                       Annotation[] anns,
                       javax.ws.rs.core.MediaType mt,
                       javax.ws.rs.core.MultivaluedMap<String,String> headers,
                       InputStream is)
                throws IOException,
                       javax.ws.rs.WebApplicationException
Specified by:
readFrom in interface javax.ws.rs.ext.MessageBodyReader<Object>
Throws:
IOException
javax.ws.rs.WebApplicationException

setAutodetectCharset

public void setAutodetectCharset(boolean autodetectCharset)

Apache CXF API

Apache CXF