public final enum

JsonToken

extends Enum<E extends Enum<E>>
java.lang.Object
   ↳ java.lang.Enum<E extends java.lang.Enum<E>>
     ↳ com.fasterxml.jackson.core.JsonToken

Class Overview

Enumeration for basic token types used for returning results of parsing JSON content.

Summary

Enum Values
JsonToken  END_ARRAY  START_OBJECT is returned when encountering ']' which signals ending of an Array value  
JsonToken  END_OBJECT  START_OBJECT is returned when encountering '}' which signals ending of an Object value  
JsonToken  FIELD_NAME  FIELD_NAME is returned when a String token is encountered as a field name (same lexical value, different function)  
JsonToken  NOT_AVAILABLE  NOT_AVAILABLE can be returned if JsonParser implementation can not currently return the requested token (usually next one), or even if any will be available, but that may be able to determine this in future. 
JsonToken  START_ARRAY  START_OBJECT is returned when encountering '[' which signals starting of an Array value  
JsonToken  START_OBJECT  START_OBJECT is returned when encountering '{' which signals starting of an Object value. 
JsonToken  VALUE_EMBEDDED_OBJECT  Placeholder token returned when the input source has a concept of embedded Object that are not accessible as usual structure (of starting with START_OBJECT, having values, ending with END_OBJECT), but as "raw" objects. 
JsonToken  VALUE_FALSE  VALUE_FALSE is returned when encountering literal "false" in value context  
JsonToken  VALUE_NULL  VALUE_NULL is returned when encountering literal "null" in value context  
JsonToken  VALUE_NUMBER_FLOAT  VALUE_NUMBER_INT is returned when a numeric token other that is not an integer is encountered: that is, a number that does have floating point or exponent marker in it, in addition to one or more digits. 
JsonToken  VALUE_NUMBER_INT  VALUE_NUMBER_INT is returned when an integer numeric token is encountered in value context: that is, a number that does not have floating point or exponent marker in it (consists only of an optional sign, followed by one or more digits)  
JsonToken  VALUE_STRING  VALUE_STRING is returned when a String token is encountered in value context (array element, field value, or root-level stand-alone value)  
JsonToken  VALUE_TRUE  VALUE_TRUE is returned when encountering literal "true" in value context  
Public Methods
byte[] asByteArray()
char[] asCharArray()
String asString()
boolean isNumeric()
boolean isScalarValue()
Method that can be used to check whether this token represents a valid non-structured value.
static JsonToken valueOf(String name)
final static JsonToken[] values()
[Expand]
Inherited Methods
From class java.lang.Enum
From class java.lang.Object
From interface java.lang.Comparable

Enum Values

public static final JsonToken END_ARRAY

START_OBJECT is returned when encountering ']' which signals ending of an Array value

public static final JsonToken END_OBJECT

START_OBJECT is returned when encountering '}' which signals ending of an Object value

public static final JsonToken FIELD_NAME

FIELD_NAME is returned when a String token is encountered as a field name (same lexical value, different function)

public static final JsonToken NOT_AVAILABLE

NOT_AVAILABLE can be returned if JsonParser implementation can not currently return the requested token (usually next one), or even if any will be available, but that may be able to determine this in future. This is the case with non-blocking parsers -- they can not block to wait for more data to parse and must return something.

public static final JsonToken START_ARRAY

START_OBJECT is returned when encountering '[' which signals starting of an Array value

public static final JsonToken START_OBJECT

START_OBJECT is returned when encountering '{' which signals starting of an Object value.

public static final JsonToken VALUE_EMBEDDED_OBJECT

Placeholder token returned when the input source has a concept of embedded Object that are not accessible as usual structure (of starting with START_OBJECT, having values, ending with END_OBJECT), but as "raw" objects.

Note: this token is never returned by regular JSON readers, but only by readers that expose other kinds of source (like JsonNode-based JSON trees, Maps, Lists and such).

public static final JsonToken VALUE_FALSE

VALUE_FALSE is returned when encountering literal "false" in value context

public static final JsonToken VALUE_NULL

VALUE_NULL is returned when encountering literal "null" in value context

public static final JsonToken VALUE_NUMBER_FLOAT

VALUE_NUMBER_INT is returned when a numeric token other that is not an integer is encountered: that is, a number that does have floating point or exponent marker in it, in addition to one or more digits.

public static final JsonToken VALUE_NUMBER_INT

VALUE_NUMBER_INT is returned when an integer numeric token is encountered in value context: that is, a number that does not have floating point or exponent marker in it (consists only of an optional sign, followed by one or more digits)

public static final JsonToken VALUE_STRING

VALUE_STRING is returned when a String token is encountered in value context (array element, field value, or root-level stand-alone value)

public static final JsonToken VALUE_TRUE

VALUE_TRUE is returned when encountering literal "true" in value context

Public Methods

public byte[] asByteArray ()

public char[] asCharArray ()

public String asString ()

public boolean isNumeric ()

public boolean isScalarValue ()

Method that can be used to check whether this token represents a valid non-structured value. This means all tokens other than Object/Array start/end markers all field names.

public static JsonToken valueOf (String name)

public static final JsonToken[] values ()