Class AdaptedObjectSerializer<T,A>
java.lang.Object
org.eclipse.yasson.internal.serializer.AdaptedObjectSerializer<T,A>
- Type Parameters:
T
- source typeA
- adapted type
- All Implemented Interfaces:
javax.json.bind.serializer.JsonbSerializer<T>
,RuntimeTypeInfo
,CurrentItem<T>
public class AdaptedObjectSerializer<T,A>
extends Object
implements CurrentItem<T>, javax.json.bind.serializer.JsonbSerializer<T>
Serializer for adapted object.
Converts object using components first, than serializes result with standard process.
-
Constructor Summary
ConstructorDescriptionAdaptedObjectSerializer(ClassModel classModel, AdapterBinding adapter)
Creates AdapterObjectSerializer. -
Method Summary
Modifier and TypeMethodDescriptionClass model containing property for this item.Returns a runtime type.CurrentItem<?>
Item wrapper.void
serialize(T obj, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx)
-
Constructor Details
-
AdaptedObjectSerializer
Creates AdapterObjectSerializer.- Parameters:
classModel
- Class model.adapter
- Adapter.
-
-
Method Details
-
serialize
public void serialize(T obj, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx)- Specified by:
serialize
in interfacejavax.json.bind.serializer.JsonbSerializer<T>
-
getClassModel
Description copied from interface:CurrentItem
Class model containing property for this item.- Specified by:
getClassModel
in interfaceCurrentItem<T>
- Returns:
- Class model.
-
getWrapper
Description copied from interface:CurrentItem
Item wrapper. Null only in case of a root item.- Specified by:
getWrapper
in interfaceCurrentItem<T>
- Specified by:
getWrapper
in interfaceRuntimeTypeInfo
- Returns:
- Wrapper item of this item.
-
getRuntimeType
Description copied from interface:RuntimeTypeInfo
Returns a runtime type. It can be a class,ParameterizedType
orTypeVariable
.- Specified by:
getRuntimeType
in interfaceRuntimeTypeInfo
- Returns:
- Runtime type or null if not defined.
-