Interface LookAheadJsonParser

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable, jakarta.json.stream.JsonParser
    All Known Implementing Classes:
    JacksonJsonpParser

    public interface LookAheadJsonParser
    extends jakarta.json.stream.JsonParser
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface jakarta.json.stream.JsonParser

        jakarta.json.stream.JsonParser.Event
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <Variant> java.util.Map.Entry<Variant,​jakarta.json.stream.JsonParser> findVariant​(java.util.Map<java.lang.String,​Variant> variants)
      In union types, find the variant to be used by looking up property names in the JSON stream until we find one that uniquely identifies the variant.
      java.util.Map.Entry<java.lang.String,​jakarta.json.stream.JsonParser> lookAheadFieldValue​(java.lang.String name, java.lang.String defaultValue)
      Look ahead the value of a text property in the JSON stream.
      • Methods inherited from interface jakarta.json.stream.JsonParser

        close, currentEvent, getArray, getArrayStream, getBigDecimal, getInt, getLocation, getLong, getObject, getObjectStream, getString, getValue, getValueStream, hasNext, isIntegralNumber, next, skipArray, skipObject
    • Method Detail

      • lookAheadFieldValue

        java.util.Map.Entry<java.lang.String,​jakarta.json.stream.JsonParser> lookAheadFieldValue​(java.lang.String name,
                                                                                                       java.lang.String defaultValue)
        Look ahead the value of a text property in the JSON stream. The parser must be on the START_OBJECT event.
        Parameters:
        name - the field name to look up.
        defaultValue - default value if the field is not found.
        Returns:
        a pair containing the field value (or null if not found), and a parser to be used to read the JSON object.
      • findVariant

        <Variant> java.util.Map.Entry<Variant,​jakarta.json.stream.JsonParser> findVariant​(java.util.Map<java.lang.String,​Variant> variants)
        In union types, find the variant to be used by looking up property names in the JSON stream until we find one that uniquely identifies the variant.
        Type Parameters:
        Variant - the type of variant descriptors used by the caller.
        Parameters:
        variants - a map of variant descriptors, keyed by the property name that uniquely identifies the variant.
        Returns:
        a pair containing the variant descriptor (or null if not found), and a parser to be used to read the JSON object.