Class FHIRJsonProvider

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyReader<javax.json.JsonObject>, javax.ws.rs.ext.MessageBodyWriter<javax.json.JsonObject>

    @Consumes({"application/fhir+json","application/json"})
    @Produces({"application/fhir+json","application/json"})
    public class FHIRJsonProvider
    extends Object
    implements javax.ws.rs.ext.MessageBodyReader<javax.json.JsonObject>, javax.ws.rs.ext.MessageBodyWriter<javax.json.JsonObject>
    Maps entity streams to/from javax.json objects
    • Constructor Detail

      • FHIRJsonProvider

        public FHIRJsonProvider​(javax.ws.rs.RuntimeType runtimeType)
    • Method Detail

      • 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.json.JsonObject>
      • readFrom

        public javax.json.JsonObject readFrom​(Class<javax.json.JsonObject> 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.json.JsonObject>
        Throws:
        IOException
        javax.ws.rs.WebApplicationException
      • 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.json.JsonObject>
      • writeTo

        public void writeTo​(javax.json.JsonObject 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.json.JsonObject>
        Throws:
        IOException
        javax.ws.rs.WebApplicationException
      • getSize

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