Package: groovy.json

## [Java] Class JsonToken

- groovy.json.JsonToken

-     public class JsonToken
      extends Object

  A JSON token, with a type, line / column information, and the text of that token.

  Since:
    1.8.0

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public long` | `getEndColumn()` Returns the ending column of this token.
    `` | `public long` | `getEndLine()` Returns the ending line of this token.
    `` | `public long` | `getStartColumn()` Returns the starting column of this token.
    `` | `public long` | `getStartLine()` Returns the starting line of this token.
    `` | `public String` | `getText()` Returns the token text.
    `` | `public JsonTokenType` | `getType()` Returns the token type.
    `` | `public Object` | `getValue()` Return the value represented by this token (i.e. a number, a string, a boolean or null).
    `` | `public void` | `setEndColumn(long endColumn)` Sets the ending column of this token.
    `` | `public void` | `setEndLine(long endLine)` Sets the ending line of this token.
    `` | `public void` | `setStartColumn(long startColumn)` Sets the starting column of this token.
    `` | `public void` | `setStartLine(long startLine)` Sets the starting line of this token.
    `` | `public void` | `setText(String text)` Sets the token text.
    `` | `public void` | `setType(JsonTokenType type)` Sets the token type.
    `` | `public String` | `toString()` Returns a debug string containing the token text, type, and source positions.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public long getEndColumn()

      Returns the ending column of this token.

      Returns:
        the ending column number

    - #### public long getEndLine()

      Returns the ending line of this token.

      Returns:
        the ending line number

    - #### public long getStartColumn()

      Returns the starting column of this token.

      Returns:
        the starting column number

    - #### public long getStartLine()

      Returns the starting line of this token.

      Returns:
        the starting line number

    - #### public String getText()

      Returns the token text.

      Returns:
        the token text

    - #### public JsonTokenType getType()

      Returns the token type.

      Returns:
        the token type

    - #### public Object getValue()

      Return the value represented by this token (i.e. a number, a string, a boolean or null). For numbers, BigDecimal is returned for decimals and Integer, Long or BigInteger for integral numbers.

      Returns:
        the represented value

    - #### public void setEndColumn(long endColumn)

      Sets the ending column of this token.

      Parameters:
        `endColumn` - the ending column number

    - #### public void setEndLine(long endLine)

      Sets the ending line of this token.

      Parameters:
        `endLine` - the ending line number

    - #### public void setStartColumn(long startColumn)

      Sets the starting column of this token.

      Parameters:
        `startColumn` - the starting column number

    - #### public void setStartLine(long startLine)

      Sets the starting line of this token.

      Parameters:
        `startLine` - the starting line number

    - #### public void setText(String text)

      Sets the token text.

      Parameters:
        `text` - the token text

    - #### public void setType(JsonTokenType type)

      Sets the token type.

      Parameters:
        `type` - the token type

    - #### public String toString()

      Returns a debug string containing the token text, type, and source positions.

      Returns:
        a string representation of this token