Class ObjectBuilderDeserializer<T,​B extends ObjectBuilder<T>>

    • Constructor Detail

      • ObjectBuilderDeserializer

        public ObjectBuilderDeserializer​(JsonpDeserializer<B> builderDeserializer)
    • Method Detail

      • lazy

        public static <B,​T> JsonpDeserializer<T> lazy​(java.util.function.Supplier<B> builderCtor,
                                                            java.util.function.Consumer<ObjectDeserializer<B>> builderDeserializerSetup,
                                                            java.util.function.Function<B,​T> buildFn)
      • deserialize

        public T deserialize​(jakarta.json.stream.JsonParser parser,
                             JsonpMapper mapper)
        Description copied from interface: JsonpDeserializer
        Deserialize a value. The value starts at the next state in the JSON stream.

        Default implementation delegates to JsonpDeserializer.deserialize(JsonParser, JsonpMapper, Event) after having checked that the next event is part of the accepted events.

        If the next event is JsonParser.Event.VALUE_NULL, null is returned unless JsonParser.Event.VALUE_NULL is part of the deserializer's accepted events.

        Parameters:
        parser - the JSON parser
        mapper - the JSON-P mapper
        Returns:
        the parsed value or null
      • deserialize

        public T deserialize​(jakarta.json.stream.JsonParser parser,
                             JsonpMapper mapper,
                             jakarta.json.stream.JsonParser.Event event)
        Description copied from interface: JsonpDeserializer
        Deserialize a value. The value starts at the current state in the JSON stream.
        Parameters:
        parser - the JSON parser
        mapper - the JSON-P mapper
        event - the current state of parser, which must be part of JsonpDeserializer.acceptedEvents()
        Returns:
        the parsed value