Package dev.dsf.fhir.adapter
Class FhirAdapter
java.lang.Object
dev.dsf.fhir.adapter.AbstractAdapter
dev.dsf.fhir.adapter.FhirAdapter
- All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<org.hl7.fhir.r4.model.BaseResource>,jakarta.ws.rs.ext.MessageBodyWriter<org.hl7.fhir.r4.model.BaseResource>
@Provider
@Consumes({"application/fhir+xml","application/xml+fhir","application/xml","text/xml","application/fhir+json","application/json+fhir","application/json"})
@Produces({"application/fhir+xml","application/xml+fhir","application/xml","text/xml","application/fhir+json","application/json+fhir","application/json"})
public class FhirAdapter
extends AbstractAdapter
implements jakarta.ws.rs.ext.MessageBodyReader<org.hl7.fhir.r4.model.BaseResource>, jakarta.ws.rs.ext.MessageBodyWriter<org.hl7.fhir.r4.model.BaseResource>
-
Field Summary
Fields inherited from class dev.dsf.fhir.adapter.AbstractAdapter
PRETTY, SUMMARY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) org.hl7.fhir.r4.model.BaseResourcereadFrom(Class<org.hl7.fhir.r4.model.BaseResource> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream) voidwriteTo(org.hl7.fhir.r4.model.BaseResource t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) Methods inherited from class dev.dsf.fhir.adapter.AbstractAdapter
getParserMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.ws.rs.ext.MessageBodyWriter
getSize
-
Constructor Details
-
FhirAdapter
public FhirAdapter(ca.uhn.fhir.context.FhirContext fhirContext)
-
-
Method Details
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isWriteablein interfacejakarta.ws.rs.ext.MessageBodyWriter<org.hl7.fhir.r4.model.BaseResource>
-
writeTo
public void writeTo(org.hl7.fhir.r4.model.BaseResource t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException- Specified by:
writeToin interfacejakarta.ws.rs.ext.MessageBodyWriter<org.hl7.fhir.r4.model.BaseResource>- Throws:
IOExceptionjakarta.ws.rs.WebApplicationException
-
isReadable
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isReadablein interfacejakarta.ws.rs.ext.MessageBodyReader<org.hl7.fhir.r4.model.BaseResource>
-
readFrom
public org.hl7.fhir.r4.model.BaseResource readFrom(Class<org.hl7.fhir.r4.model.BaseResource> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException- Specified by:
readFromin interfacejakarta.ws.rs.ext.MessageBodyReader<org.hl7.fhir.r4.model.BaseResource>- Throws:
IOExceptionjakarta.ws.rs.WebApplicationException
-