Class SourceProvider<T>

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

@Provider @Produces({"application/xml","application/*+xml","text/xml"}) @Consumes({"application/xml","application/*+xml","text/xml","text/html"}) public class SourceProvider<T> extends AbstractConfigurableProvider implements jakarta.ws.rs.ext.MessageBodyReader<T>, jakarta.ws.rs.ext.MessageBodyWriter<T>
  • Constructor Details

    • SourceProvider

      public SourceProvider()
  • Method Details

    • isWriteable

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

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

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

      protected XMLStreamReader getReader(InputStream is)
    • configureReaderRestrictions

      protected XMLStreamReader configureReaderRestrictions(XMLStreamReader reader)
    • getRealStream

      protected InputStream getRealStream(InputStream is) throws IOException
      Throws:
      IOException
    • getReaderFromMessage

      protected XMLStreamReader getReaderFromMessage()
    • writeTo

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

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

      protected String getPreferredSource()
    • getContext

      protected MessageContext getContext()