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 ofCollectionvalue
- 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
ConstructorsModifierConstructorDescriptionprotectedCollectionSerializer(SerializerBuilder builder) Creates new collection serializer. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidserializeInternal(Collection<V> collection, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx) Serialize content of provided container.protected voidwriteStart(String key, javax.json.stream.JsonGenerator generator) Write start of an object or an array with a key.protected voidwriteStart(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, writeEndMethods 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:AbstractContainerSerializerSerialize content of provided container.- Specified by:
serializeInternalin 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:AbstractContainerSerializerWrite start of an object or an array without a key.- Specified by:
writeStartin classAbstractContainerSerializer<Collection<V>>- Parameters:
generator- JSON format generator
-
writeStart
Description copied from class:AbstractContainerSerializerWrite start of an object or an array with a key.- Specified by:
writeStartin classAbstractContainerSerializer<Collection<V>>- Parameters:
key- JSON key name.generator- JSON format generator
-