Class PositionChecker

java.lang.Object
org.eclipse.yasson.internal.deserializer.PositionChecker
All Implemented Interfaces:
ModelDeserializer<jakarta.json.stream.JsonParser>

public class PositionChecker extends Object implements ModelDeserializer<jakarta.json.stream.JsonParser>
JSON document position checker.
Checks whether json parser is in expected state. If not it will try to skip to the next event, since if user defined components are involved, it is possible to expect incorrect states in terms of the last expected events. If this checker is still not in expected state, an exception is thrown.
  • Constructor Details

    • PositionChecker

      public PositionChecker(ModelDeserializer<jakarta.json.stream.JsonParser> delegate, Type rType, PositionChecker.Checker checker)
      Create new instance.
      Parameters:
      delegate - delegate which is call after the check
      rType - runtime type
      checker - bound group of events
    • PositionChecker

      public PositionChecker(ModelDeserializer<jakarta.json.stream.JsonParser> delegate, Type rType, jakarta.json.stream.JsonParser.Event... events)
      Create new instance.
      Parameters:
      delegate - delegate which is call after the check
      rType - runtime type
      events - customized checked events
  • Method Details

    • deserialize

      public Object deserialize(jakarta.json.stream.JsonParser value, DeserializationContextImpl context)
      Description copied from interface: ModelDeserializer
      Deserialize provided value or delegate deserialization to the next deserializer.
      Specified by:
      deserialize in interface ModelDeserializer<jakarta.json.stream.JsonParser>
      Parameters:
      value - value to be deserialized
      context - deserialization context
      Returns:
      deserialized value
    • toString

      public String toString()
      Overrides:
      toString in class Object