Class ObjectSerializer<T>
java.lang.Object
org.eclipse.yasson.internal.serializer.AbstractItem<T>
org.eclipse.yasson.internal.serializer.AbstractContainerSerializer<T>
org.eclipse.yasson.internal.serializer.ObjectSerializer<T>
- Type Parameters:
T- object type
- All Implemented Interfaces:
javax.json.bind.serializer.JsonbSerializer<T>,RuntimeTypeInfo,CurrentItem<T>
Serializes arbitrary object by reading its properties.
-
Constructor Summary
ConstructorsConstructorDescriptionObjectSerializer(CurrentItem<?> wrapper, Type runtimeType, ClassModel classModel) Creates a new instance.ObjectSerializer(SerializerBuilder builder) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidserializeInternal(T object, 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
-
ObjectSerializer
Creates a new instance.- Parameters:
builder- Builder to initialize the instance.
-
ObjectSerializer
Creates a new instance.- Parameters:
wrapper- wrapped itemruntimeType- class typeclassModel- model of the class
-
-
Method Details
-
serializeInternal
protected void serializeInternal(T object, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx) Description copied from class:AbstractContainerSerializerSerialize content of provided container.- Specified by:
serializeInternalin classAbstractContainerSerializer<T>- Parameters:
object- 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<T>- 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<T>- Parameters:
key- JSON key name.generator- JSON format generator
-