public class StreamingOutputMarshaller extends Object implements jakarta.ws.rs.core.StreamingOutput
StreamingOutput
implementation that uses the provided
JAXBContext
to marshal the result when requested to either XML or
JSON based on the accept media provided.Constructor and Description |
---|
StreamingOutputMarshaller(PersistenceContext context,
Object result,
List<jakarta.ws.rs.core.MediaType> acceptedTypes)
Creates a new StreamingOutputMarshaller.
|
StreamingOutputMarshaller(PersistenceContext context,
Object result,
List<jakarta.ws.rs.core.MediaType> acceptedTypes,
FieldsFilter filter)
This constructor is used for fields filtering.
|
StreamingOutputMarshaller(PersistenceContext context,
Object result,
jakarta.ws.rs.core.MediaType acceptedType) |
Modifier and Type | Method and Description |
---|---|
static jakarta.xml.bind.Marshaller |
createMarshaller(PersistenceContext context,
jakarta.ws.rs.core.MediaType mediaType) |
static jakarta.ws.rs.core.MediaType |
getResponseMediaType(jakarta.ws.rs.core.HttpHeaders headers) |
static jakarta.ws.rs.core.MediaType |
mediaType(List<jakarta.ws.rs.core.MediaType> types)
Identify the preferred
MediaType from the list provided. |
void |
write(OutputStream output) |
public StreamingOutputMarshaller(PersistenceContext context, Object result, jakarta.ws.rs.core.MediaType acceptedType)
public StreamingOutputMarshaller(PersistenceContext context, Object result, List<jakarta.ws.rs.core.MediaType> acceptedTypes, FieldsFilter filter)
context
- persistence context.result
- entity to process.acceptedTypes
- accepted media types.filter
- containing a list of fields to filter out from the response.public StreamingOutputMarshaller(PersistenceContext context, Object result, List<jakarta.ws.rs.core.MediaType> acceptedTypes)
context
- persistence context.result
- entity to process.acceptedTypes
- accepted media types.public void write(OutputStream output) throws IOException, jakarta.ws.rs.WebApplicationException
write
in interface jakarta.ws.rs.core.StreamingOutput
IOException
jakarta.ws.rs.WebApplicationException
public static jakarta.ws.rs.core.MediaType mediaType(List<jakarta.ws.rs.core.MediaType> types)
MediaType
from the list provided. This
will check for JSON string or MediaType
first then XML.types
- List of MediaType
values;MediaType
public static jakarta.xml.bind.Marshaller createMarshaller(PersistenceContext context, jakarta.ws.rs.core.MediaType mediaType) throws jakarta.xml.bind.JAXBException
jakarta.xml.bind.JAXBException
public static jakarta.ws.rs.core.MediaType getResponseMediaType(jakarta.ws.rs.core.HttpHeaders headers)
Copyright © 2007–2021 Eclipse.org - EclipseLink Project. All rights reserved.