com.fasterxml.jackson.core.json

## Class DupDetector

- java.lang.Object
- - com.fasterxml.jackson.core.json.DupDetector

-     public class DupDetector
      extends Object

  Helper class used if `JsonParser.Feature.STRICT_DUPLICATE_DETECTION` is enabled. Optimized to try to limit memory usage and processing overhead for smallest entries, but without adding trashing (immutable objects would achieve optimal memory usage but lead to significant number of discarded temp objects for scopes with large number of entries). Another consideration is trying to limit actual number of compiled classes as it contributes significantly to overall jar size (due to linkage etc).
  Since:
    2.3

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `_firstName`
    `protected String` | `_secondName`
    `protected HashSet<String>` | `_seen` Lazily constructed set of names already seen within this context.
    `protected Object` | `_source` We need to store a back-reference here to parser/generator, unfortunately.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DupDetector` | `child()`
    `JsonLocation` | `findLocation()`
    `boolean` | `isDup(String name)`
    `void` | `reset()`
    `static DupDetector` | `rootDetector(JsonGenerator g)`
    `static DupDetector` | `rootDetector(JsonParser p)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _source

          protected final Object _source

      We need to store a back-reference here to parser/generator, unfortunately.

    - #### _firstName

          protected String _firstName

    - #### _secondName

          protected String _secondName

    - #### _seen

          protected HashSet<String> _seen

      Lazily constructed set of names already seen within this context.

  - ### Method Detail

    - #### rootDetector

          public static DupDetector rootDetector(JsonParser p)

    - #### rootDetector

          public static DupDetector rootDetector(JsonGenerator g)

    - #### child

          public DupDetector child()

    - #### reset

          public void reset()

    - #### findLocation

          public JsonLocation findLocation()

    - #### isDup

          public boolean isDup(String name)
                        throws JsonParseException

      Throws:
        `JsonParseException`

Copyright © 2014-2015 FasterXML. All Rights Reserved.