Class SourceProvider.SourceWriter

  • All Implemented Interfaces:
    javax.ws.rs.ext.MessageBodyWriter<javax.xml.transform.Source>
    Enclosing class:
    SourceProvider

    @Produces({"application/xml","text/xml","*/*"})
    @Consumes({"application/xml","text/xml","*/*"})
    @Singleton
    public static final class SourceProvider.SourceWriter
    extends java.lang.Object
    implements javax.ws.rs.ext.MessageBodyWriter<javax.xml.transform.Source>
    Provider for marshaling Source instances.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.inject.Provider<javax.xml.parsers.SAXParserFactory> saxParserFactory  
      private javax.inject.Provider<javax.xml.transform.TransformerFactory> transformerFactory  
    • Constructor Summary

      Constructors 
      Constructor Description
      SourceWriter​(javax.inject.Provider<javax.xml.parsers.SAXParserFactory> spf, javax.inject.Provider<javax.xml.transform.TransformerFactory> tf)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getSize​(javax.xml.transform.Source o, 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<?> t, java.lang.reflect.Type gt, java.lang.annotation.Annotation[] as, javax.ws.rs.core.MediaType mediaType)  
      void writeTo​(javax.xml.transform.Source source, java.lang.Class<?> t, java.lang.reflect.Type gt, java.lang.annotation.Annotation[] as, 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

      • saxParserFactory

        private final javax.inject.Provider<javax.xml.parsers.SAXParserFactory> saxParserFactory
      • transformerFactory

        private final javax.inject.Provider<javax.xml.transform.TransformerFactory> transformerFactory
    • Constructor Detail

      • SourceWriter

        public SourceWriter​(@Context
                            javax.inject.Provider<javax.xml.parsers.SAXParserFactory> spf,
                            @Context
                            javax.inject.Provider<javax.xml.transform.TransformerFactory> tf)
    • Method Detail

      • isWriteable

        public boolean isWriteable​(java.lang.Class<?> t,
                                   java.lang.reflect.Type gt,
                                   java.lang.annotation.Annotation[] as,
                                   javax.ws.rs.core.MediaType mediaType)
        Specified by:
        isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<javax.xml.transform.Source>
      • getSize

        public long getSize​(javax.xml.transform.Source o,
                            java.lang.Class<?> type,
                            java.lang.reflect.Type genericType,
                            java.lang.annotation.Annotation[] annotations,
                            javax.ws.rs.core.MediaType mediaType)
        Specified by:
        getSize in interface javax.ws.rs.ext.MessageBodyWriter<javax.xml.transform.Source>
      • writeTo

        public void writeTo​(javax.xml.transform.Source source,
                            java.lang.Class<?> t,
                            java.lang.reflect.Type gt,
                            java.lang.annotation.Annotation[] as,
                            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
        Specified by:
        writeTo in interface javax.ws.rs.ext.MessageBodyWriter<javax.xml.transform.Source>
        Throws:
        java.io.IOException