Class JsonToken

  • All Implemented Interfaces:
    java.lang.CharSequence, java.lang.Comparable<CharSlice>, Stringable

    public class JsonToken
    extends CharSlice
    Since:
    19.10.15
    Author:
    Stein Eldar Johnsen
    • Constructor Detail

      • JsonToken

        public JsonToken​(JsonToken.Type type,
                         char[] lineBuffer,
                         int offset,
                         int len,
                         int lineNo,
                         int linePos)
    • Method Detail

      • getLineNo

        public int getLineNo()
        Returns:
        The line number (1-indexed).
      • getLinePos

        public int getLinePos()
        Returns:
        The start position on the line (0-indexed).
      • isNull

        public boolean isNull()
      • isSymbol

        public boolean isSymbol()
      • isSymbol

        public final boolean isSymbol​(char c)
      • isLiteral

        public boolean isLiteral()
      • isBoolean

        public boolean isBoolean()
      • isNumber

        public boolean isNumber()
      • isInteger

        public boolean isInteger()
      • isDouble

        public boolean isDouble()
      • booleanValue

        public boolean booleanValue()
      • byteValue

        public byte byteValue()
      • shortValue

        public short shortValue()
      • intValue

        public int intValue()
      • longValue

        public long longValue()
      • doubleValue

        public double doubleValue()
      • rawJsonLiteral

        public java.lang.String rawJsonLiteral()
        Get the still quoted string literal content.
        Returns:
        The raw string literal.
      • decodeJsonLiteral

        public java.lang.String decodeJsonLiteral()
        Get the whole slice as a string.
        Returns:
        Slice decoded as UTF_8 string.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class CharSlice
      • toString

        @Nonnull
        public java.lang.String toString()
        Specified by:
        toString in interface java.lang.CharSequence
        Overrides:
        toString in class CharSlice