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 java.lang.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
Constructors Constructor Description AdaptedObjectSerializer(ClassModel classModel, AdapterBinding adapter)Creates AdapterObjectSerializer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassModelgetClassModel()Class model containing property for this item.java.lang.reflect.TypegetRuntimeType()Returns a runtime type.CurrentItem<?>getWrapper()Item wrapper.voidserialize(T obj, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx)
-
-
-
Constructor Detail
-
AdaptedObjectSerializer
public AdaptedObjectSerializer(ClassModel classModel, AdapterBinding adapter)
Creates AdapterObjectSerializer.- Parameters:
classModel- Class model.adapter- Adapter.
-
-
Method Detail
-
serialize
public void serialize(T obj, javax.json.stream.JsonGenerator generator, javax.json.bind.serializer.SerializationContext ctx)
- Specified by:
serializein interfacejavax.json.bind.serializer.JsonbSerializer<T>
-
getClassModel
public ClassModel getClassModel()
Description copied from interface:CurrentItemClass model containing property for this item.- Specified by:
getClassModelin interfaceCurrentItem<T>- Returns:
- Class model.
-
getWrapper
public CurrentItem<?> getWrapper()
Description copied from interface:CurrentItemItem wrapper. Null only in case of a root item.- Specified by:
getWrapperin interfaceCurrentItem<T>- Specified by:
getWrapperin interfaceRuntimeTypeInfo- Returns:
- Wrapper item of this item.
-
getRuntimeType
public java.lang.reflect.Type getRuntimeType()
Description copied from interface:RuntimeTypeInfoReturns a runtime type. It can be a class,ParameterizedTypeorTypeVariable.- Specified by:
getRuntimeTypein interfaceRuntimeTypeInfo- Returns:
- Runtime type or null if not defined.
-
-