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 void
serializeInternal(T object, 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
-
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:AbstractContainerSerializer
Serialize content of provided container.- Specified by:
serializeInternal
in 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:AbstractContainerSerializer
Write start of an object or an array without a key.- Specified by:
writeStart
in classAbstractContainerSerializer<T>
- 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<T>
- Parameters:
key
- JSON key name.generator
- JSON format generator
-