Class JsonCollectionWriter
java.lang.Object
com.tangosol.coherence.rest.providers.JsonCollectionWriter
- All Implemented Interfaces:
- jakarta.ws.rs.ext.MessageBodyWriter<Object>
@Provider
@Produces("application/json")
public class JsonCollectionWriter
extends Object
implements jakarta.ws.rs.ext.MessageBodyWriter<Object>
Provider responsible for converting Java collections to a JSON formatted
 stream.
- Author:
- vp 2011.06.29
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected MarshallerRegistryMarshaller registry to obtain element marshallers from.
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor.JsonCollectionWriter(MarshallerRegistry registry) Construct a JsonCollectionWriter instance.
- 
Method SummaryModifier and TypeMethodDescriptionlonggetSize(Object col, Class<?> clz, Type type, Annotation[] aAnnotation, jakarta.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> clz, Type type, Annotation[] aAnnotation, jakarta.ws.rs.core.MediaType mediaType) voidwriteTo(Object oCol, Class<?> clz, Type type, Annotation[] aAnnotation, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream stream) 
- 
Field Details- 
m_marshallerRegistryMarshaller registry to obtain element marshallers from.
 
- 
- 
Constructor Details- 
JsonCollectionWriterpublic JsonCollectionWriter()Default constructor.
- 
JsonCollectionWriterConstruct a JsonCollectionWriter instance.- Parameters:
- registry- marshaller registry to use
 
 
- 
- 
Method Details- 
isWriteablepublic boolean isWriteable(Class<?> clz, Type type, Annotation[] aAnnotation, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
- isWriteablein interface- jakarta.ws.rs.ext.MessageBodyWriter<Object>
 
- 
getSizepublic long getSize(Object col, Class<?> clz, Type type, Annotation[] aAnnotation, jakarta.ws.rs.core.MediaType mediaType) - Specified by:
- getSizein interface- jakarta.ws.rs.ext.MessageBodyWriter<Object>
 
- 
writeTopublic void writeTo(Object oCol, Class<?> clz, Type type, Annotation[] aAnnotation, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, Object> httpHeaders, OutputStream stream) throws IOException, jakarta.ws.rs.WebApplicationException- Specified by:
- writeToin interface- jakarta.ws.rs.ext.MessageBodyWriter<Object>
- Throws:
- IOException
- jakarta.ws.rs.WebApplicationException
 
 
-