Class SimpleTypeJsonProvider<T>

java.lang.Object
org.apache.cxf.jaxrs.provider.AbstractConfigurableProvider
org.apache.cxf.jaxrs.provider.json.SimpleTypeJsonProvider<T>
All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyReader<T>, jakarta.ws.rs.ext.MessageBodyWriter<T>

@Produces("application/json") @Consumes("application/json") public class SimpleTypeJsonProvider<T> extends AbstractConfigurableProvider implements jakarta.ws.rs.ext.MessageBodyWriter<T>, jakarta.ws.rs.ext.MessageBodyReader<T>
  • Constructor Details

    • SimpleTypeJsonProvider

      public SimpleTypeJsonProvider()
  • Method Details

    • isWriteable

      public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
      Specified by:
      isWriteable in interface jakarta.ws.rs.ext.MessageBodyWriter<T>
    • getSize

      public long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
      Specified by:
      getSize in interface jakarta.ws.rs.ext.MessageBodyWriter<T>
    • writeTo

      public void writeTo(T t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,Object> headers, OutputStream os) throws IOException, jakarta.ws.rs.WebApplicationException
      Specified by:
      writeTo in interface jakarta.ws.rs.ext.MessageBodyWriter<T>
      Throws:
      IOException
      jakarta.ws.rs.WebApplicationException
    • setSupportSimpleTypesOnly

      public void setSupportSimpleTypesOnly(boolean supportSimpleTypesOnly)
    • isReadable

      public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType)
      Specified by:
      isReadable in interface jakarta.ws.rs.ext.MessageBodyReader<T>
    • readFrom

      public T readFrom(Class<T> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String,String> headers, InputStream is) throws IOException, jakarta.ws.rs.WebApplicationException
      Specified by:
      readFrom in interface jakarta.ws.rs.ext.MessageBodyReader<T>
      Throws:
      IOException
      jakarta.ws.rs.WebApplicationException