Class UTF8FaunaParser


  • public final class UTF8FaunaParser
    extends java.lang.Object
    Represents a reader that provides fast, non-cached, forward-only access to serialized data.
    • Constructor Detail

      • UTF8FaunaParser

        public UTF8FaunaParser​(com.fasterxml.jackson.core.JsonParser jsonParser)
        Constructs a UTF8FaunaParser instance with the given JSON parser.
        Parameters:
        jsonParser - The JsonParser used to read the JSON data.
    • Method Detail

      • fromInputStream

        public static UTF8FaunaParser fromInputStream​(java.io.InputStream body)
                                               throws CodecException
        Creates a UTF8FaunaParser from an InputStream.
        Parameters:
        body - The input stream of JSON data.
        Returns:
        A UTF8FaunaParser instance.
        Throws:
        CodecException - if an IOException occurs while creating the parser.
      • fromString

        public static UTF8FaunaParser fromString​(java.lang.String str)
        Creates a UTF8FaunaParser from a JSON string
        Parameters:
        str - The JSON string.
        Returns:
        A UTF8FaunaParser instance.
      • getCurrentTokenType

        public FaunaTokenType getCurrentTokenType()
        Retrieves the current Fauna token type.
        Returns:
        The FaunaTokenType currently being processed.
      • skip

        public void skip()
        Skips the current object or array in the JSON data.
      • read

        public boolean read()
                     throws CodecException
        Reads the next token from the JSON parser.
        Returns:
        true if there is another token to read, false if there are no more tokens.
        Throws:
        CodecException - if there is an error reading the token.
      • getValueAsCharacter

        public java.lang.Character getValueAsCharacter()
        Retrieves the value as a Character if the current token type is FaunaTokenType.INT.
        Returns:
        The current value as a Character.
      • getValueAsString

        public java.lang.String getValueAsString()
        Retrieves the current value as a String.
        Returns:
        The current value as a String.
      • getTaggedValueAsString

        public java.lang.String getTaggedValueAsString()
        Retrieves the tagged value as a String.
        Returns:
        The tagged value as a String.
      • getValueAsByteArray

        public byte[] getValueAsByteArray()
        Retrieves the value as a byte array if the current token type is FaunaTokenType.BYTES.
        Returns:
        The current value as a byte array.
      • getValueAsByte

        public java.lang.Byte getValueAsByte()
        Retrieves the value as a Byte if the current token type is FaunaTokenType.INT.
        Returns:
        The current value as a Byte.
      • getValueAsShort

        public java.lang.Short getValueAsShort()
        Retrieves the value as a Short if the current token type is FaunaTokenType.INT.
        Returns:
        The current value as a Short.
      • getValueAsInt

        public java.lang.Integer getValueAsInt()
        Retrieves the value as an Integer if the current token type is FaunaTokenType.INT or FaunaTokenType.LONG.
        Returns:
        The current value as an Integer.
      • getValueAsBoolean

        public java.lang.Boolean getValueAsBoolean()
        Retrieves the current value as a Boolean.
        Returns:
        The current value as a Boolean.
      • getValueAsLocalDate

        public java.time.LocalDate getValueAsLocalDate()
        Retrieves the current value as a LocalDate if the current token type is FaunaTokenType.DATE.
        Returns:
        The current value as a LocalDate.
      • getValueAsTime

        public java.time.Instant getValueAsTime()
        Retrieves the current value as an Instant if the current token type is FaunaTokenType.TIME.
        Returns:
        The current value as an Instant.
      • getValueAsLong

        public java.lang.Long getValueAsLong()
        Retrieves the value as a Long if the current token type is FaunaTokenType.INT or FaunaTokenType.LONG.
        Returns:
        The current value as a Long.