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>
public class ObjectSerializer<T> extends AbstractContainerSerializer<T>
Serializes arbitrary object by reading its properties.
-
-
Constructor Summary
Constructors Constructor Description ObjectSerializer(CurrentItem<?> wrapper, java.lang.reflect.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 voidserializeInternal(T object, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx)Serialize content of provided container.protected voidwriteStart(java.lang.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, 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, java.lang.reflect.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)
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
protected void writeStart(java.lang.String key, javax.json.stream.JsonGenerator generator)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
-
-