Class ObjectDeserializer<ObjectType>

All Implemented Interfaces:

public class ObjectDeserializer<ObjectType>
extends java.lang.Object
implements JsonpDeserializer<ObjectType>
  • Field Details

  • Constructor Details

    • ObjectDeserializer

      public ObjectDeserializer​(java.util.function.Supplier<ObjectType> constructor)
  • Method Details

    • fieldNames

      public java.util.Set<java.lang.String> fieldNames()
      Return the top-level property names of the target type for this deserializer.
    • shortcutProperty

      @Nullable public java.lang.String shortcutProperty()
    • nativeEvents

      public java.util.EnumSet<> nativeEvents()
      Description copied from interface: JsonpDeserializer
      The native JSON events this deserializer accepts as a starting point. For example, native events for a boolean are JsonParser.Event.VALUE_TRUE and JsonParser.Event.VALUE_FALSE.
      Specified by:
      nativeEvents in interface JsonpDeserializer<ObjectType>
    • acceptedEvents

      public java.util.EnumSet<> acceptedEvents()
      Description copied from interface: JsonpDeserializer
      The JSON events this deserializer accepts as a starting point. For example, events for a boolean are JsonParser.Event.VALUE_TRUE, JsonParser.Event.VALUE_FALSE and JsonParser.Event.VALUE_STRING, the latter being converted to a boolean using Boolean.parseBoolean(String).
      Specified by:
      acceptedEvents in interface JsonpDeserializer<ObjectType>
    • deserialize

      public ObjectType deserialize​( parser, JsonpMapper mapper, event)
      Description copied from interface: JsonpDeserializer
      Deserialize a value. The value starts at the current state in the JSON stream.
      Specified by:
      deserialize in interface JsonpDeserializer<ObjectType>
      parser - the JSON parser
      mapper - the JSON-P mapper
      event - the current state of parser, which must be part of JsonpDeserializer.acceptedEvents()
      the parsed value
    • deserialize

      public ObjectType deserialize​(ObjectType value, parser, JsonpMapper mapper, event)
    • parseUnknownField

      protected void parseUnknownField​( parser, JsonpMapper mapper, java.lang.String fieldName, ObjectType object)
    • setUnknownFieldHandler

      public void setUnknownFieldHandler​(QuadConsumer<ObjectType,​java.lang.String,​,​JsonpMapper> unknownFieldHandler)
    • ignore

      public void ignore​(java.lang.String name)
    • shortcutProperty

      public void shortcutProperty​(java.lang.String name)
    • add

      public <FieldType> void add​(java.util.function.BiConsumer<ObjectType,​FieldType> setter, JsonpDeserializer<FieldType> deserializer, java.lang.String name)
    • add

      public <FieldType> void add​(java.util.function.BiConsumer<ObjectType,​FieldType> setter, JsonpDeserializer<FieldType> deserializer, java.lang.String name, java.lang.String... aliases)
    • setKey

      public <FieldType> void setKey​(java.util.function.BiConsumer<ObjectType,​FieldType> setter, JsonpDeserializer<FieldType> deserializer)
    • setTypeProperty

      public void setTypeProperty​(java.lang.String name, java.lang.String defaultType)
    • add

      public void add​(java.util.function.ObjIntConsumer<ObjectType> setter, java.lang.String name, java.lang.String... deprecatedNames)