1 package com.fasterxml.jackson.core;
2 
3 /**
4  * Interface defined to contain ids accessible with {@link JsonToken#id()}.
5  * Needed because it is impossible to define these constants in
6  * {@link JsonToken} itself, as static constants (oddity of how Enums
7  * are implemented by JVM).
8  *
9  * @since 2.3
10  */
11 public interface JsonTokenId
12 {
13     /**
14      * Id used to represent {@link JsonToken#NOT_AVAILABLE}, used in
15      * cases where a token may become available when more input
16      * is available: this occurs in non-blocking use cases.
17      */
18     public final static int ID_NOT_AVAILABLE = -1;
19 
20     /**
21      * Id used to represent the case where no {@link JsonToken}
22      * is available: either because {@link JsonParser} has not been
23      * advanced to first token, or because no more tokens will be
24      * available (end-of-input or explicit closing of parser}.
25      */
26     public final static int ID_NO_TOKEN = 0;
27 
28     /**
29      * Id used to represent {@link JsonToken#START_OBJECT}
30      */
31     public final static int ID_START_OBJECT = 1;
32 
33     /**
34      * Id used to represent {@link JsonToken#END_OBJECT}
35      */
36     public final static int ID_END_OBJECT = 2;
37 
38     /**
39      * Id used to represent {@link JsonToken#START_ARRAY}
40      */
41     public final static int ID_START_ARRAY = 3;
42 
43     /**
44      * Id used to represent {@link JsonToken#END_ARRAY}
45      */
46     public final static int ID_END_ARRAY = 4;
47 
48     /**
49      * Id used to represent {@link JsonToken#FIELD_NAME}
50      */
51     public final static int ID_FIELD_NAME = 5;
52 
53     /**
54      * Id used to represent {@link JsonToken#VALUE_STRING}
55      */
56     public final static int ID_STRING = 6;
57 
58     /**
59      * Id used to represent {@link JsonToken#VALUE_NUMBER_INT}
60      */
61     public final static int ID_NUMBER_INT = 7;
62 
63     /**
64      * Id used to represent {@link JsonToken#VALUE_NUMBER_FLOAT}
65      */
66     public final static int ID_NUMBER_FLOAT = 8;
67 
68     /**
69      * Id used to represent {@link JsonToken#VALUE_TRUE}
70      */
71     public final static int ID_TRUE = 9;
72 
73     /**
74      * Id used to represent {@link JsonToken#VALUE_FALSE}
75      */
76     public final static int ID_FALSE = 10;
77     /**
78      * Id used to represent {@link JsonToken#VALUE_NULL}
79      */
80 
81     public final static int ID_NULL = 11;
82 
83     /**
84      * Id used to represent {@link JsonToken#VALUE_EMBEDDED_OBJECT}
85      */
86     public final static int ID_EMBEDDED_OBJECT = 12;
87 }
88