Class CollectionWriter
java.lang.Object
ee.jakarta.tck.ws.rs.common.AbstractMessageBodyRW
ee.jakarta.tck.ws.rs.ee.resource.java2entity.CollectionWriter
- All Implemented Interfaces:
jakarta.ws.rs.ext.MessageBodyWriter<Collection<?>>
@Provider
public class CollectionWriter
extends AbstractMessageBodyRW
implements jakarta.ws.rs.ext.MessageBodyWriter<Collection<?>>
If isWritable arguments are passed according to the spec, writes OK,
otherwise IncorrectCollectionWriter writes ERROR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetSize(Collection<?> t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) voidwriteTo(Collection<?> t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) Methods inherited from class ee.jakarta.tck.ws.rs.common.AbstractMessageBodyRW
getPathValue, getSpecifiedAnnotation, getSpecifiedAnnotationValue
-
Constructor Details
-
CollectionWriter
public CollectionWriter()
-
-
Method Details
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
isWriteablein interfacejakarta.ws.rs.ext.MessageBodyWriter<Collection<?>>
-
getSize
public long getSize(Collection<?> t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
getSizein interfacejakarta.ws.rs.ext.MessageBodyWriter<Collection<?>>
-
writeTo
public void writeTo(Collection<?> t, Class<?> type, Type genericType, Annotation[] annotations, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, jakarta.ws.rs.WebApplicationException- Specified by:
writeToin interfacejakarta.ws.rs.ext.MessageBodyWriter<Collection<?>>- Throws:
IOExceptionjakarta.ws.rs.WebApplicationException
-