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>
-
- All Implemented Interfaces:
javax.json.bind.serializer.JsonbSerializer<T>
,RuntimeTypeInfo
,CurrentItem<T>
public class ObjectSerializer<T> extends AbstractContainerSerializer<T>
Serializes arbitrary object by reading its properties.- Author:
- Roman Grigoriadi
-
-
Constructor Summary
Constructors Constructor Description ObjectSerializer(CurrentItem<?> wrapper, Type runtimeType, ClassModel classModel)
Creates a new instance.ObjectSerializer(SerializerBuilder builder)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
serializeInternal(T object, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx)
protected void
writeStart(String key, javax.json.stream.JsonGenerator generator)
Write start object or start array with key.protected void
writeStart(javax.json.stream.JsonGenerator generator)
Write start object or start array without a key.-
Methods inherited from class org.eclipse.yasson.internal.serializer.AbstractContainerSerializer
addValueSerializer, getValueSerializer, getValueType, serialize, serializeItem, serializerCaptor, writeEnd
-
Methods inherited from class org.eclipse.yasson.internal.serializer.AbstractItem
getClassModel, getRuntimeType, getWrapper
-
-
-
-
Constructor Detail
-
ObjectSerializer
public ObjectSerializer(SerializerBuilder builder)
Creates a new instance.- Parameters:
builder
- Builder to initialize the instance.
-
ObjectSerializer
public ObjectSerializer(CurrentItem<?> wrapper, Type runtimeType, ClassModel classModel)
Creates a new instance.- Parameters:
wrapper
- wrapped itemruntimeType
- class typeclassModel
- model of the class
-
-
Method Detail
-
serializeInternal
protected void serializeInternal(T object, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx)
- Specified by:
serializeInternal
in classAbstractContainerSerializer<T>
-
writeStart
protected void writeStart(javax.json.stream.JsonGenerator generator)
Description copied from class:AbstractContainerSerializer
Write start object or start array without a key.- Specified by:
writeStart
in classAbstractContainerSerializer<T>
- Parameters:
generator
- JSON generator.
-
writeStart
protected void writeStart(String key, javax.json.stream.JsonGenerator generator)
Description copied from class:AbstractContainerSerializer
Write start object or start array with key.- Specified by:
writeStart
in classAbstractContainerSerializer<T>
- Parameters:
key
- JSON key name.generator
- JSON generator.
-
-