Package groovy.json
Class JsonToken
java.lang.Object
groovy.json.JsonToken
A JSON token, with a type, line / column information, and the text of that token.
- Since:
- 1.8.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the ending column of this token.longReturns the ending line of this token.longReturns the starting column of this token.longReturns the starting line of this token.getText()Returns the token text.getType()Returns the token type.getValue()Return the value represented by this token (i.e.voidsetEndColumn(long endColumn) Sets the ending column of this token.voidsetEndLine(long endLine) Sets the ending line of this token.voidsetStartColumn(long startColumn) Sets the starting column of this token.voidsetStartLine(long startLine) Sets the starting line of this token.voidSets the token text.voidsetType(JsonTokenType type) Sets the token type.toString()Returns a debug string containing the token text, type, and source positions.
-
Constructor Details
-
JsonToken
public JsonToken()
-
-
Method Details
-
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
-
toString
Returns a debug string containing the token text, type, and source positions. -
getStartLine
public long getStartLine()Returns the starting line of this token.- Returns:
- the starting line number
-
setStartLine
public void setStartLine(long startLine) Sets the starting line of this token.- Parameters:
startLine- the starting line number
-
getEndLine
public long getEndLine()Returns the ending line of this token.- Returns:
- the ending line number
-
setEndLine
public void setEndLine(long endLine) Sets the ending line of this token.- Parameters:
endLine- the ending line number
-
getStartColumn
public long getStartColumn()Returns the starting column of this token.- Returns:
- the starting column number
-
setStartColumn
public void setStartColumn(long startColumn) Sets the starting column of this token.- Parameters:
startColumn- the starting column number
-
getEndColumn
public long getEndColumn()Returns the ending column of this token.- Returns:
- the ending column number
-
setEndColumn
public void setEndColumn(long endColumn) Sets the ending column of this token.- Parameters:
endColumn- the ending column number
-
getType
Returns the token type.- Returns:
- the token type
-
setType
Sets the token type.- Parameters:
type- the token type
-
setText
Sets the token text.- Parameters:
text- the token text
-
getText
Returns the token text.- Returns:
- the token text
-