Class MapDeserializer<T extends Map<?,?>>
java.lang.Object
org.eclipse.yasson.internal.serializer.AbstractItem<T>
org.eclipse.yasson.internal.serializer.AbstractContainerDeserializer<T>
org.eclipse.yasson.internal.serializer.MapDeserializer<T>
- Type Parameters:
T
- map type
- All Implemented Interfaces:
javax.json.bind.serializer.JsonbDeserializer<T>
,RuntimeTypeInfo
,CurrentItem<T>
,EmbeddedItem
public class MapDeserializer<T extends Map<?,?>>
extends AbstractContainerDeserializer<T>
implements EmbeddedItem
Item implementation for
Map
fields.
According to JSON specification object can have only string keys.
Nevertheless the implementation lets the key be a basic object that was
serialized into a string representation. Therefore the key is also parsed to
convert it into its parametrized type.-
Constructor Summary
ModifierConstructorDescriptionprotected
MapDeserializer(DeserializerBuilder builder)
Create instance of current item with its builder. -
Method Summary
Modifier and TypeMethodDescriptionvoid
appendResult(Object result, Unmarshaller context)
After object is transitively deserialized from JSON, "append" it to its wrapper.protected void
deserializeNext(javax.json.stream.JsonParser parser, Unmarshaller context)
Determine class mappings and create an instance of a new deserializer.getInstance(Unmarshaller unmarshaller)
Creates and initializes an instance of deserializing item.protected JsonbRiParser.LevelContext
moveToFirst(JsonbParser parser)
Move to first event for current deserializer structure.Methods inherited from class org.eclipse.yasson.internal.serializer.AbstractContainerDeserializer
convertNullToOptionalEmpty, deserialize, deserializeInternal, newCollectionOrMapItem, newUnmarshallerItemBuilder
Methods inherited from class org.eclipse.yasson.internal.serializer.AbstractItem
getClassModel, getRuntimeType, getWrapper
-
Constructor Details
-
MapDeserializer
Create instance of current item with its builder.- Parameters:
builder
-DeserializerBuilder
used to build this instance
-
-
Method Details
-
getInstance
Description copied from class:AbstractContainerDeserializer
Creates and initializes an instance of deserializing item.- Specified by:
getInstance
in classAbstractContainerDeserializer<T extends Map<?,?>>
- Parameters:
unmarshaller
- Current deserialization context.- Returns:
- An instance of deserializing item.
-
appendResult
Description copied from class:AbstractContainerDeserializer
After object is transitively deserialized from JSON, "append" it to its wrapper. In case of a field set value to field, in case of collections or other embedded objects use methods provided.- Specified by:
appendResult
in classAbstractContainerDeserializer<T extends Map<?,?>>
- Parameters:
result
- An instance result of an item.context
- Current unmarshalling context.
-
deserializeNext
Description copied from class:AbstractContainerDeserializer
Determine class mappings and create an instance of a new deserializer. Currently processed deserializer is pushed to stack, for waiting till new object is finished.- Specified by:
deserializeNext
in classAbstractContainerDeserializer<T extends Map<?,?>>
- Parameters:
parser
- Json parser.context
- Current unmarshalling context.
-
moveToFirst
Description copied from class:AbstractContainerDeserializer
Move to first event for current deserializer structure.- Specified by:
moveToFirst
in classAbstractContainerDeserializer<T extends Map<?,?>>
- Parameters:
parser
- Json parser.- Returns:
- First event.
-