Class JettisonJaxbElementProvider

All Implemented Interfaces:
MessageBodyReader<jakarta.xml.bind.JAXBElement<?>>, MessageBodyWriter<jakarta.xml.bind.JAXBElement<?>>
Direct Known Subclasses:
JettisonJaxbElementProvider.App, JettisonJaxbElementProvider.General

public class JettisonJaxbElementProvider extends AbstractJaxbElementProvider
JSON message entity media type provider (reader & writer) for JAXBElement type.
Author:
Jakub Podlesak
  • Method Details

    • isReadable

      public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
      Specified by:
      isReadable in interface MessageBodyReader<jakarta.xml.bind.JAXBElement<?>>
      Overrides:
      isReadable in class AbstractJaxbElementProvider
    • isWriteable

      public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
      Specified by:
      isWriteable in interface MessageBodyWriter<jakarta.xml.bind.JAXBElement<?>>
      Overrides:
      isWriteable in class AbstractJaxbElementProvider
    • readFrom

      protected final jakarta.xml.bind.JAXBElement<?> readFrom(Class<?> type, MediaType mediaType, jakarta.xml.bind.Unmarshaller unmarshaller, InputStream entityStream) throws jakarta.xml.bind.JAXBException
      Description copied from class: AbstractJaxbElementProvider
      Read JAXB element from an entity stream.
      Specified by:
      readFrom in class AbstractJaxbElementProvider
      Parameters:
      type - the type that is to be read from the entity stream.
      mediaType - the media type of the HTTP entity.
      unmarshaller - JAXB unmarshaller to be used.
      entityStream - the InputStream of the HTTP entity. The caller is responsible for ensuring that the input stream ends when the entity has been consumed. The implementation should not close the input stream.
      Returns:
      JAXB element representing the entity.
      Throws:
      jakarta.xml.bind.JAXBException - in case entity unmarshalling fails.
    • writeTo

      protected final void writeTo(jakarta.xml.bind.JAXBElement<?> t, MediaType mediaType, Charset c, jakarta.xml.bind.Marshaller m, OutputStream entityStream) throws jakarta.xml.bind.JAXBException
      Description copied from class: AbstractJaxbElementProvider
      Write JAXB element to an entity stream.
      Specified by:
      writeTo in class AbstractJaxbElementProvider
      Parameters:
      t - JAXB element to be written to an entity stream.
      mediaType - the media type of the HTTP entity.
      c - character set to be used.
      m - JAXB unmarshaller to be used.
      entityStream - the InputStream of the HTTP entity. The caller is responsible for ensuring that the input stream ends when the entity has been consumed. The implementation should not close the input stream.
      Throws:
      jakarta.xml.bind.JAXBException - in case entity marshalling fails.