Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package divconq.json3;

Interface defined to contain ids accessible with JsonToken.id(). Needed because it is impossible to define these constants in JsonToken itself, as static constants (oddity of how Enums are implemented by JVM).

Since:
2.3
public interface JsonTokenId
{
    
Id used to represent JsonToken.NOT_AVAILABLE, used in cases where a token may become available when more input is available: this occurs in non-blocking use cases.
    public final static int ID_NOT_AVAILABLE = -1;

    
Id used to represent the case where no JsonToken is available: either because JsonParser has not been advanced to first token, or because no more tokens will be available (end-of-input or explicit closing of parser}.
    public final static int ID_NO_TOKEN = 0;

    
Id used to represent JsonToken.START_OBJECT
    public final static int ID_START_OBJECT = 1;

    
Id used to represent JsonToken.END_OBJECT
    public final static int ID_END_OBJECT = 2;

    
Id used to represent JsonToken.START_ARRAY
    public final static int ID_START_ARRAY = 3;

    
Id used to represent JsonToken.END_ARRAY
    public final static int ID_END_ARRAY = 4;

    
Id used to represent JsonToken.FIELD_NAME
    public final static int ID_FIELD_NAME = 5;

    
Id used to represent JsonToken.VALUE_STRING
    public final static int ID_STRING = 6;

    
Id used to represent JsonToken.VALUE_NUMBER_INT
    public final static int ID_NUMBER_INT = 7;

    
Id used to represent JsonToken.VALUE_NUMBER_FLOAT
    public final static int ID_NUMBER_FLOAT = 8;

    
Id used to represent JsonToken.VALUE_TRUE
    public final static int ID_TRUE = 9;

    
Id used to represent JsonToken.VALUE_FALSE
    public final static int ID_FALSE = 10;
    
Id used to represent JsonToken.VALUE_NULL
    public final static int ID_NULL = 11;

    
Id used to represent JsonToken.VALUE_EMBEDDED_OBJECT
    public final static int ID_EMBEDDED_OBJECT = 12;
New to GrepCode? Check out our FAQ X