Class JaxbStringReaderProvider

  • Direct Known Subclasses:
    JaxbStringReaderProvider.RootElementProvider

    public class JaxbStringReaderProvider
    extends java.lang.Object
    String reader provider producing param converter provider that support conversion of a string value into a JAXB instance.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Map<java.lang.Class,​javax.xml.bind.JAXBContext> jaxbContexts  
      private Value<javax.ws.rs.ext.ContextResolver<javax.xml.bind.JAXBContext>> mtContext  
      private Value<javax.ws.rs.ext.ContextResolver<javax.xml.bind.Unmarshaller>> mtUnmarshaller  
    • Constructor Summary

      Constructors 
      Constructor Description
      JaxbStringReaderProvider​(javax.ws.rs.ext.Providers ps)
      Create JAXB string reader provider.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private javax.xml.bind.JAXBContext getJAXBContext​(java.lang.Class type)  
      protected javax.xml.bind.JAXBContext getStoredJAXBContext​(java.lang.Class type)
      Get the stored JAXB context supporting the Java type.
      protected javax.xml.bind.Unmarshaller getUnmarshaller​(java.lang.Class type)
      Get JAXB unmarshaller for the type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • jaxbContexts

        private static final java.util.Map<java.lang.Class,​javax.xml.bind.JAXBContext> jaxbContexts
      • mtContext

        private final Value<javax.ws.rs.ext.ContextResolver<javax.xml.bind.JAXBContext>> mtContext
      • mtUnmarshaller

        private final Value<javax.ws.rs.ext.ContextResolver<javax.xml.bind.Unmarshaller>> mtUnmarshaller
    • Constructor Detail

      • JaxbStringReaderProvider

        public JaxbStringReaderProvider​(javax.ws.rs.ext.Providers ps)
        Create JAXB string reader provider.
        Parameters:
        ps - used to obtain JAXBContext and Unmarshaller ContextResolvers
    • Method Detail

      • getUnmarshaller

        protected final javax.xml.bind.Unmarshaller getUnmarshaller​(java.lang.Class type)
                                                             throws javax.xml.bind.JAXBException
        Get JAXB unmarshaller for the type.
        Parameters:
        type - Java type to be unmarshalled.
        Returns:
        JAXB unmarshaller for the given type.
        Throws:
        javax.xml.bind.JAXBException - in case there's an error retrieving the unmarshaller.
      • getJAXBContext

        private javax.xml.bind.JAXBContext getJAXBContext​(java.lang.Class type)
                                                   throws javax.xml.bind.JAXBException
        Throws:
        javax.xml.bind.JAXBException
      • getStoredJAXBContext

        protected javax.xml.bind.JAXBContext getStoredJAXBContext​(java.lang.Class type)
                                                           throws javax.xml.bind.JAXBException
        Get the stored JAXB context supporting the Java type.
        Parameters:
        type - Java type supported by the stored JAXB context.
        Returns:
        stored JAXB context supporting the Java type.
        Throws:
        javax.xml.bind.JAXBException - in case JAXB context retrieval fails.