Class StreamingOutputMarshaller
java.lang.Object
org.eclipse.persistence.jpa.rs.util.StreamingOutputMarshaller
- All Implemented Interfaces:
StreamingOutput
Simple
StreamingOutput implementation that uses the provided
JAXBContext to marshal the result when requested to either XML or
JSON based on the accept media provided.- Since:
- EclipseLink 2.4.0
-
Constructor Summary
ConstructorsConstructorDescriptionStreamingOutputMarshaller(PersistenceContext context, Object result, MediaType acceptedType) StreamingOutputMarshaller(PersistenceContext context, Object result, List<MediaType> acceptedTypes) Creates a new StreamingOutputMarshaller.StreamingOutputMarshaller(PersistenceContext context, Object result, List<MediaType> acceptedTypes, FieldsFilter filter) This constructor is used for fields filtering. -
Method Summary
Modifier and TypeMethodDescriptionstatic MarshallercreateMarshaller(PersistenceContext context, MediaType mediaType) static MediaTypegetResponseMediaType(HttpHeaders headers) static MediaTypeIdentify the preferredMediaTypefrom the list provided.voidwrite(OutputStream output)
-
Constructor Details
-
StreamingOutputMarshaller
-
StreamingOutputMarshaller
public StreamingOutputMarshaller(PersistenceContext context, Object result, List<MediaType> acceptedTypes, FieldsFilter filter) This constructor is used for fields filtering. Only attributes included in fields parameter are marshalled.- Parameters:
context- persistence context.result- entity to process.acceptedTypes- accepted media types.filter- containing a list of fields to filter out from the response.
-
StreamingOutputMarshaller
public StreamingOutputMarshaller(PersistenceContext context, Object result, List<MediaType> acceptedTypes) Creates a new StreamingOutputMarshaller.- Parameters:
context- persistence context.result- entity to process.acceptedTypes- accepted media types.
-
-
Method Details
-
write
- Specified by:
writein interfaceStreamingOutput- Throws:
IOExceptionWebApplicationException
-
mediaType
-
createMarshaller
public static Marshaller createMarshaller(PersistenceContext context, MediaType mediaType) throws JAXBException - Throws:
JAXBException
-
getResponseMediaType
-