org.apache.wink.providers.jettison
Class JettisonJAXBElementProvider

java.lang.Object
  extended by org.apache.wink.common.internal.providers.entity.xml.AbstractJAXBProvider
      extended by org.apache.wink.providers.jettison.JettisonJAXBElementProvider
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<javax.xml.bind.JAXBElement<?>>, javax.ws.rs.ext.MessageBodyWriter<javax.xml.bind.JAXBElement<?>>

@Provider
public class JettisonJAXBElementProvider
extends org.apache.wink.common.internal.providers.entity.xml.AbstractJAXBProvider
implements javax.ws.rs.ext.MessageBodyReader<javax.xml.bind.JAXBElement<?>>, javax.ws.rs.ext.MessageBodyWriter<javax.xml.bind.JAXBElement<?>>

A Jettison JAXBElement provider. By default, use the BadgerFishConvention. Namespace mapping needs to be set if namespaces are used. In Application sub-class, use Application.getSingletons() to add to application.


Field Summary
 
Fields inherited from class org.apache.wink.common.internal.providers.entity.xml.AbstractJAXBProvider
contextCacheOn, jaxbTypeMapCache, providers
 
Constructor Summary
JettisonJAXBElementProvider()
           
JettisonJAXBElementProvider(boolean isBadgerFishConventionUsed, org.codehaus.jettison.mapped.Configuration reader, org.codehaus.jettison.mapped.Configuration writer)
           
 
Method Summary
 long getSize(javax.xml.bind.JAXBElement<?> t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 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 mediaType)
           
 javax.xml.bind.JAXBElement<?> readFrom(Class<javax.xml.bind.JAXBElement<?>> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream)
           
 void setUseAsReader(boolean isReadable)
           
 void setUseAsWriter(boolean isWritable)
           
 void writeTo(javax.xml.bind.JAXBElement<?> t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream)
           
 
Methods inherited from class org.apache.wink.common.internal.providers.entity.xml.AbstractJAXBProvider
closeXMLStreamReader, getConcreteTypeFromTypeMap, getContext, getContext, getEntityToMarshal, getJAXBMarshaller, getJAXBUnmarshaller, getXMLStreamReader, getXMLStreamReader, isCompatible, isJAXBElement, isJAXBObject, isJAXBObject, isSupportedMediaType, marshalWithXmlAdapter, releaseJAXBMarshaller, releaseJAXBUnmarshaller, unmarshalWithXmlAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JettisonJAXBElementProvider

public JettisonJAXBElementProvider()

JettisonJAXBElementProvider

public JettisonJAXBElementProvider(boolean isBadgerFishConventionUsed,
                                   org.codehaus.jettison.mapped.Configuration reader,
                                   org.codehaus.jettison.mapped.Configuration writer)
Method Detail

setUseAsReader

public void setUseAsReader(boolean isReadable)

setUseAsWriter

public void setUseAsWriter(boolean isWritable)

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<javax.xml.bind.JAXBElement<?>>

readFrom

public javax.xml.bind.JAXBElement<?> readFrom(Class<javax.xml.bind.JAXBElement<?>> type,
                                              Type genericType,
                                              Annotation[] annotations,
                                              javax.ws.rs.core.MediaType mediaType,
                                              javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
                                              InputStream entityStream)
                                       throws IOException,
                                              javax.ws.rs.WebApplicationException
Specified by:
readFrom in interface javax.ws.rs.ext.MessageBodyReader<javax.xml.bind.JAXBElement<?>>
Throws:
IOException
javax.ws.rs.WebApplicationException

getSize

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

isWriteable

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

writeTo

public void writeTo(javax.xml.bind.JAXBElement<?> t,
                    Class<?> type,
                    Type genericType,
                    Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap<String,Object> httpHeaders,
                    OutputStream entityStream)
             throws IOException,
                    javax.ws.rs.WebApplicationException
Specified by:
writeTo in interface javax.ws.rs.ext.MessageBodyWriter<javax.xml.bind.JAXBElement<?>>
Throws:
IOException
javax.ws.rs.WebApplicationException


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.