Class SourceProvider.SourceWriter
java.lang.Object
org.glassfish.jersey.message.internal.SourceProvider.SourceWriter
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<Source>
- Enclosing class:
SourceProvider
@Produces({"application/xml","text/xml","*/*"})
@Consumes({"application/xml","text/xml","*/*"})
@Singleton
public static final class SourceProvider.SourceWriter
extends Object
implements javax.ws.rs.ext.MessageBodyWriter<Source>
Provider for marshaling
Source
instances.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final javax.inject.Provider
<SAXParserFactory> private final javax.inject.Provider
<TransformerFactory> -
Constructor Summary
ConstructorsConstructorDescriptionSourceWriter
(javax.inject.Provider<SAXParserFactory> spf, javax.inject.Provider<TransformerFactory> tf) -
Method Summary
Modifier and TypeMethodDescriptionlong
getSize
(Source o, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) boolean
isWriteable
(Class<?> t, Type gt, Annotation[] as, javax.ws.rs.core.MediaType mediaType) void
writeTo
(Source source, Class<?> t, Type gt, Annotation[] as, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream)
-
Field Details
-
saxParserFactory
-
transformerFactory
-
-
Constructor Details
-
SourceWriter
public SourceWriter(@Context javax.inject.Provider<SAXParserFactory> spf, @Context javax.inject.Provider<TransformerFactory> tf)
-
-
Method Details
-
isWriteable
public boolean isWriteable(Class<?> t, Type gt, Annotation[] as, javax.ws.rs.core.MediaType mediaType) - Specified by:
isWriteable
in interfacejavax.ws.rs.ext.MessageBodyWriter<Source>
-
getSize
public long getSize(Source o, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
getSize
in interfacejavax.ws.rs.ext.MessageBodyWriter<Source>
-
writeTo
public void writeTo(Source source, Class<?> t, Type gt, Annotation[] as, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException- Specified by:
writeTo
in interfacejavax.ws.rs.ext.MessageBodyWriter<Source>
- Throws:
IOException
-