Class CollectionSerializer<V>
java.lang.Object
org.eclipse.yasson.internal.serializer.AbstractItem<T>
org.eclipse.yasson.internal.serializer.AbstractContainerSerializer<Collection<V>>
org.eclipse.yasson.internal.serializer.CollectionSerializer<V>
- Type Parameters:
V
- type ofCollection
value
- All Implemented Interfaces:
javax.json.bind.serializer.JsonbSerializer<Collection<V>>
,RuntimeTypeInfo
,CurrentItem<Collection<V>>
,EmbeddedItem
public class CollectionSerializer<V>
extends AbstractContainerSerializer<Collection<V>>
implements EmbeddedItem
Serializer for collections.
-
Constructor Summary
ModifierConstructorDescriptionprotected
CollectionSerializer(SerializerBuilder builder)
Creates new collection serializer. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
serializeInternal(Collection<V> collection, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx)
Serialize content of provided container.protected void
writeStart(String key, javax.json.stream.JsonGenerator generator)
Write start of an object or an array with a key.protected void
writeStart(javax.json.stream.JsonGenerator generator)
Write start of an object or an array without a key.Methods inherited from class org.eclipse.yasson.internal.serializer.AbstractContainerSerializer
addValueSerializer, beforeSerialize, getValueSerializer, getValueType, serialize, serializeItem, serializerCaptor, writeEnd
Methods inherited from class org.eclipse.yasson.internal.serializer.AbstractItem
getClassModel, getRuntimeType, getWrapper
-
Constructor Details
-
CollectionSerializer
Creates new collection serializer.- Parameters:
builder
- serializer builder
-
-
Method Details
-
serializeInternal
protected void serializeInternal(Collection<V> collection, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx)Description copied from class:AbstractContainerSerializer
Serialize content of provided container.- Specified by:
serializeInternal
in classAbstractContainerSerializer<Collection<V>>
- Parameters:
collection
- container to be serializedgenerator
- JSON format generatorctx
- JSON serialization context
-
writeStart
protected void writeStart(javax.json.stream.JsonGenerator generator)Description copied from class:AbstractContainerSerializer
Write start of an object or an array without a key.- Specified by:
writeStart
in classAbstractContainerSerializer<Collection<V>>
- Parameters:
generator
- JSON format generator
-
writeStart
Description copied from class:AbstractContainerSerializer
Write start of an object or an array with a key.- Specified by:
writeStart
in classAbstractContainerSerializer<Collection<V>>
- Parameters:
key
- JSON key name.generator
- JSON format generator
-