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>

@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(Entry entry, Object o, Class<?> pojoClass)
           
protected
<X> boolean
buildFeed(Feed feed, X o, Class<?> pojoClass)
           
protected  void createEntryContent(Entry e, Object o, Class<?> cls)
           
protected  Entry createEntryFromObject(Object o, Class<?> cls)
           
protected  Feed createFeedFromCollectionWrapper(Object o, Class<?> pojoClass)
           
protected  Writer createWriter(String writerName)
           
protected  AbstractAtomElementBuilder<?> getAtomBuilder(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)
           
 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 setCollectionGetters(Map<String,String> methods)
           
 void setCollectionSetters(Map<String,String> methods)
           
protected  void setEntryContent(Entry e, String content)
           
 void setEntryContentMethodName(String name)
           
protected  void setEntryProperties(Factory factory, Entry entry, Object o, Class<?> cls)
           
protected  void setFeedFromCollection(Factory factory, Feed feed, Object wrapper, Class<?> wrapperCls, Object collection, Class<?> collectionCls, Type collectionType, boolean writerUsed)
           
protected  void setFeedProperties(Factory factory, 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, 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 Writer createWriter(String writerName)

setFormattedOutput

public void setFormattedOutput(boolean formattedOutput)

createFeedFromCollectionWrapper

protected Feed createFeedFromCollectionWrapper(Object o,
                                               Class<?> pojoClass)
                                        throws Exception
Throws:
Exception

buildFeed

protected <X> boolean buildFeed(Feed feed,
                                X o,
                                Class<?> pojoClass)

getAtomWriter

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

getAtomReader

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

setFeedFromCollection

protected void setFeedFromCollection(Factory factory,
                                     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(Factory factory,
                                 Feed feed,
                                 Object wrapper,
                                 Class<?> wrapperCls,
                                 Object collection,
                                 Class<?> collectionCls,
                                 Type collectionType)

createEntryFromObject

protected Entry createEntryFromObject(Object o,
                                      Class<?> cls)
                               throws Exception
Throws:
Exception

buildEntry

protected boolean buildEntry(Entry entry,
                             Object o,
                             Class<?> pojoClass)

createEntryContent

protected void createEntryContent(Entry e,
                                  Object o,
                                  Class<?> cls)
                           throws Exception
Throws:
Exception

setEntryContent

protected void setEntryContent(Entry e,
                               String content)

setEntryProperties

protected void setEntryProperties(Factory factory,
                                  Entry entry,
                                  Object o,
                                  Class<?> cls)

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

Apache CXF API

Apache CXF