Example usage for com.fasterxml.jackson.core JsonParser getCurrentLocation

List of usage examples for com.fasterxml.jackson.core JsonParser getCurrentLocation

Introduction

In this page you can find the example usage for com.fasterxml.jackson.core JsonParser getCurrentLocation.

Prototype

public abstract JsonLocation getCurrentLocation();

Source Link

Document

Method that returns location of the last processed character; usually for error reporting purposes.

Usage

From source file:org.apache.drill.common.logical.data.Sequence.java

private static void throwE(JsonParser jp, String e) throws JsonParseException {
    throw new JsonParseException(e, jp.getCurrentLocation());
}

From source file:com.microsoft.azure.storage.core.JsonUtilities.java

/***
 * Reserved for internal use. Asserts that the token type of the parser is the end of an array.
 * //w  w  w. j a v a 2 s  .  c  o m
 * @param parser
 *            The {@link JsonParser} whose current token to check.
 */
public static void assertIsEndArrayJsonToken(final JsonParser parser) throws JsonParseException {
    if (!(parser.getCurrentToken() == JsonToken.END_ARRAY)) {
        throw new JsonParseException(SR.EXPECTED_END_ARRAY, parser.getCurrentLocation());
    }
}

From source file:com.microsoft.azure.storage.table.ODataUtilities.java

/***
 * Reserved for internal use. Asserts that the token type of the parser is the end of an array.
 * /*ww w  .j a va2s .c o m*/
 * @param parser
 *            The {@link JsonParser} whose current token to check.
 */
protected static void assertIsEndArrayJsonToken(final JsonParser parser) throws JsonParseException {
    if (!(parser.getCurrentToken() == JsonToken.END_ARRAY)) {
        throw new JsonParseException(SR.EXPECTED_END_ARRAY, parser.getCurrentLocation());
    }
}

From source file:com.microsoft.azure.storage.core.JsonUtilities.java

/***
 * Reserved for internal use. Asserts that the current token of the parser is the end of an object.
 * /*from w w w .  j av a  2s  . c o  m*/
 * @param parser
 *            The {@link JsonParser} whose current token to check.
 */
public static void assertIsEndObjectJsonToken(final JsonParser parser) throws JsonParseException {
    if (!(parser.getCurrentToken() == JsonToken.END_OBJECT)) {
        throw new JsonParseException(SR.EXPECTED_END_OBJECT, parser.getCurrentLocation());
    }
}

From source file:com.microsoft.azure.storage.table.ODataUtilities.java

/***
 * Reserved for internal use. Asserts that the current token of the parser is the end of an object.
 * /*from  ww w .  j a  va  2s.c o m*/
 * @param parser
 *            The {@link JsonParser} whose current token to check.
 */
protected static void assertIsEndObjectJsonToken(final JsonParser parser) throws JsonParseException {
    if (!(parser.getCurrentToken() == JsonToken.END_OBJECT)) {
        throw new JsonParseException(SR.EXPECTED_END_OBJECT, parser.getCurrentLocation());
    }
}

From source file:com.microsoft.azure.storage.core.JsonUtilities.java

/***
 * Reserved for internal use. Asserts that the current token of the parser is a field name.
 * // w w  w.j  av  a2 s .c  om
 * @param parser
 *            The {@link JsonParser} whose current token to check.
 */
public static void assertIsFieldNameJsonToken(final JsonParser parser) throws JsonParseException {
    if (!(parser.getCurrentToken() == JsonToken.FIELD_NAME)) {
        throw new JsonParseException(SR.EXPECTED_A_FIELD_NAME, parser.getCurrentLocation());
    }
}

From source file:com.microsoft.azure.storage.core.JsonUtilities.java

/***
 * Reserved for internal use. Asserts that the token type of the parser is the start of an array.
 * /*from w w w  .j  ava 2 s.c o m*/
 * @param parser
 *            The {@link JsonParser} whose current token to check.
 */
public static void assertIsStartArrayJsonToken(final JsonParser parser) throws JsonParseException {
    if (!(parser.getCurrentToken() == JsonToken.START_ARRAY)) {
        throw new JsonParseException(SR.EXPECTED_START_ARRAY, parser.getCurrentLocation());
    }
}

From source file:com.microsoft.azure.storage.table.ODataUtilities.java

/***
 * Reserved for internal use. Asserts that the current token of the parser is a field name.
 * //from ww w . j a  v a  2s.c o  m
 * @param parser
 *            The {@link JsonParser} whose current token to check.
 */
protected static void assertIsFieldNameJsonToken(final JsonParser parser) throws JsonParseException {
    if (!(parser.getCurrentToken() == JsonToken.FIELD_NAME)) {
        throw new JsonParseException(SR.EXPECTED_A_FIELD_NAME, parser.getCurrentLocation());
    }
}

From source file:com.microsoft.azure.storage.table.ODataUtilities.java

/***
 * Reserved for internal use. Asserts that the token type of the parser is the start of an array.
 * /* w  ww.  j a v  a 2s . c  o m*/
 * @param parser
 *            The {@link JsonParser} whose current token to check.
 */
protected static void assertIsStartArrayJsonToken(final JsonParser parser) throws JsonParseException {
    if (!(parser.getCurrentToken() == JsonToken.START_ARRAY)) {
        throw new JsonParseException(SR.EXPECTED_START_ARRAY, parser.getCurrentLocation());
    }
}

From source file:com.microsoft.azure.storage.core.JsonUtilities.java

/***
 * Reserved for internal use. Asserts that the current token of the parser is the start of an object.
 * //w w  w . j ava  2 s. co  m
 * @param parser
 *            The {@link JsonParser} whose current token to check.
 */
public static void assertIsStartObjectJsonToken(final JsonParser parser) throws JsonParseException {
    if (!(parser.getCurrentToken() == JsonToken.START_OBJECT)) {
        throw new JsonParseException(SR.EXPECTED_START_OBJECT, parser.getCurrentLocation());
    }
}