Class AbstractContainerDeserializer<T>

    • Method Detail

      • deserialize

        public final T deserialize​(jakarta.json.stream.JsonParser parser,
                                   jakarta.json.bind.serializer.DeserializationContext context,
                                   java.lang.reflect.Type rtType)
        Drives JSONP JsonParser to deserialize json document.
        Specified by:
        deserialize in interface jakarta.json.bind.serializer.JsonbDeserializer<T>
        Parameters:
        parser - JSON parser.
        context - Deseriaization context.
        rtType - Runtime type.
        Returns:
        Instance of a type for this item.
      • getInstance

        protected abstract T getInstance​(Unmarshaller unmarshaller)
        Creates and initializes an instance of deserializing item.
        Parameters:
        unmarshaller - Current deserialization context.
        Returns:
        An instance of deserializing item.
      • deserializeInternal

        protected void deserializeInternal​(JsonbParser parser,
                                           Unmarshaller context)
        Deserialize specific item type.
        Parameters:
        parser - jsonb parser
        context - context
      • deserializeNext

        protected abstract void deserializeNext​(jakarta.json.stream.JsonParser parser,
                                                Unmarshaller context)
        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.
        Parameters:
        parser - Json parser.
        context - Current unmarshalling context.
      • moveToFirst

        protected abstract JsonbRiParser.LevelContext moveToFirst​(JsonbParser parser)
        Move to first event for current deserializer structure.
        Parameters:
        parser - Json parser.
        Returns:
        First event.
      • newUnmarshallerItemBuilder

        protected DeserializerBuilder newUnmarshallerItemBuilder​(JsonbContext ctx)
        Returns new deserialization builder for specific item.
        Parameters:
        ctx - jsonb context
        Returns:
        deserialization builder
      • newCollectionOrMapItem

        protected jakarta.json.bind.serializer.JsonbDeserializer<?> newCollectionOrMapItem​(java.lang.reflect.Type valueType,
                                                                                           JsonbContext ctx)
        Returns new deserialization builder for specific collection or map.
        Parameters:
        valueType - value type
        ctx - jsonb context
        Returns:
        deserialization builder
      • convertNullToOptionalEmpty

        protected java.lang.Object convertNullToOptionalEmpty​(java.lang.reflect.Type propertyType,
                                                              java.lang.Object value)
        If value is null and property model type is one of Optional, OptionalDouble, OptionalInt, or OptionalLong, value of corresponding Optional#empty() is returned.
        Parameters:
        propertyType - property type
        value - value to set
        Returns:
        empty optional if applies
      • appendResult

        public abstract void appendResult​(java.lang.Object result)
        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.
        Parameters:
        result - An instance result of an item.