Class AsDeductionTypeDeserializer

  • All Implemented Interfaces:
    java.io.Serializable

    public class AsDeductionTypeDeserializer
    extends AsPropertyTypeDeserializer
    A TypeDeserializer capable of deducing polymorphic types based on the fields available. Deduction is limited to the names of child properties (not their values or, consequently, any nested descendants). Exceptions will be thrown if not enough unique information is present to select a single subtype.

    The current deduction process does not support pojo-hierarchies such that the absence of child fields infers a parent type. That is, every deducible subtype MUST have some unique fields and the input data MUST contain said unique fields to provide a positive match.

    Since:
    2.12
    See Also:
    Serialized Form
    • Field Detail

      • EMPTY_CLASS_FINGERPRINT

        private static final java.util.BitSet EMPTY_CLASS_FINGERPRINT
      • fieldBitIndex

        private final java.util.Map<java.lang.String,​java.lang.Integer> fieldBitIndex
      • subtypeFingerprints

        private final java.util.Map<java.util.BitSet,​java.lang.String> subtypeFingerprints
    • Method Detail

      • buildFingerprints

        protected java.util.Map<java.util.BitSet,​java.lang.String> buildFingerprints​(DeserializationConfig config,
                                                                                           java.util.Collection<NamedType> subtypes)
      • prune

        private static void prune​(java.util.List<java.util.BitSet> candidates,
                                  int bit)