Class DocumentProvider

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyReader<org.w3c.dom.Document>, javax.ws.rs.ext.MessageBodyWriter<org.w3c.dom.Document>

    @Produces({"application/xml","text/xml","*/*"})
    @Consumes({"application/xml","text/xml","*/*"})
    @Singleton
    public final class DocumentProvider
    extends AbstractMessageReaderWriterProvider<org.w3c.dom.Document>
    Provider for marshalling/un-marshalling XML document instances.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.inject.Provider<javax.xml.parsers.DocumentBuilderFactory> dbf  
      private javax.inject.Provider<javax.xml.transform.TransformerFactory> tf  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isReadable​(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)  
      boolean isWriteable​(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)  
      org.w3c.dom.Document readFrom​(java.lang.Class<org.w3c.dom.Document> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> httpHeaders, java.io.InputStream entityStream)  
      void writeTo​(org.w3c.dom.Document t, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> httpHeaders, java.io.OutputStream entityStream)  
      • Methods inherited from class java.lang.Object

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

      • dbf

        @Inject
        private javax.inject.Provider<javax.xml.parsers.DocumentBuilderFactory> dbf
      • tf

        @Inject
        private javax.inject.Provider<javax.xml.transform.TransformerFactory> tf
    • Constructor Detail

      • DocumentProvider

        public DocumentProvider()
    • Method Detail

      • isReadable

        public boolean isReadable​(java.lang.Class<?> type,
                                  java.lang.reflect.Type genericType,
                                  java.lang.annotation.Annotation[] annotations,
                                  javax.ws.rs.core.MediaType mediaType)
      • readFrom

        public org.w3c.dom.Document readFrom​(java.lang.Class<org.w3c.dom.Document> type,
                                             java.lang.reflect.Type genericType,
                                             java.lang.annotation.Annotation[] annotations,
                                             javax.ws.rs.core.MediaType mediaType,
                                             javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.String> httpHeaders,
                                             java.io.InputStream entityStream)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • isWriteable

        public boolean isWriteable​(java.lang.Class<?> type,
                                   java.lang.reflect.Type genericType,
                                   java.lang.annotation.Annotation[] annotations,
                                   javax.ws.rs.core.MediaType mediaType)
      • writeTo

        public void writeTo​(org.w3c.dom.Document t,
                            java.lang.Class<?> type,
                            java.lang.reflect.Type genericType,
                            java.lang.annotation.Annotation[] annotations,
                            javax.ws.rs.core.MediaType mediaType,
                            javax.ws.rs.core.MultivaluedMap<java.lang.String,​java.lang.Object> httpHeaders,
                            java.io.OutputStream entityStream)
                     throws java.io.IOException
        Throws:
        java.io.IOException