Class JAXBObjectEntityProvider

java.lang.Object
org.exoplatform.services.rest.impl.provider.JAXBObjectEntityProvider
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyReader<Object>, javax.ws.rs.ext.MessageBodyWriter<Object>, EntityProvider<Object>

@Provider public class JAXBObjectEntityProvider extends Object implements EntityProvider<Object>
Version:
$Id: $
Author:
Andrey Parfonov
  • Constructor Details

    • JAXBObjectEntityProvider

      public JAXBObjectEntityProvider()
  • Method Details

    • 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> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException
      Specified by:
      readFrom in interface javax.ws.rs.ext.MessageBodyReader<Object>
      Throws:
      IOException
    • getSize

      public long getSize(Object t, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
      Specified by:
      getSize in interface javax.ws.rs.ext.MessageBodyWriter<Object>
    • 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<Object>
    • writeTo

      public void writeTo(Object 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
      Specified by:
      writeTo in interface javax.ws.rs.ext.MessageBodyWriter<Object>
      Throws:
      IOException
    • getJAXBContext

      protected javax.xml.bind.JAXBContext getJAXBContext(Class<?> type, javax.ws.rs.core.MediaType mediaType) throws javax.xml.bind.JAXBException
      Parameters:
      type - type
      mediaType - media type
      Returns:
      JAXBContext JAXBContext
      Throws:
      javax.xml.bind.JAXBException - if JAXBContext creation failed