Package org.codehaus.jackson

Examples of org.codehaus.jackson.JsonParseException


  }

  @Deprecated
  public static void ensureObjectClosed( @Nonnull JsonParser parser ) throws JsonParseException {
    if ( parser.getCurrentToken() != JsonToken.END_OBJECT ) {
      throw new JsonParseException( "No consumed everything " + parser.getCurrentToken(), parser.getCurrentLocation() );
    }
  }
View Full Code Here


  }

  @Deprecated
  public static void ensureParserClosed( @Nonnull JsonParser parser ) throws IOException {
    if ( parser.nextToken() != null ) {
      throw new JsonParseException( "No consumed everything " + parser.getCurrentToken(), parser.getCurrentLocation() );
    }

    parser.close();
  }
View Full Code Here

  public static void nextField( @Nonnull JsonParser parser, @Nonnull String fieldName ) throws IOException {
    nextToken( parser, JsonToken.FIELD_NAME );
    String currentName = parser.getCurrentName();

    if ( !fieldName.equals( currentName ) ) {
      throw new JsonParseException( "Invalid field. Expected <" + fieldName + "> but was <" + currentName + ">", parser.getCurrentLocation() );
    }
  }
View Full Code Here

  @Deprecated
  public static void verifyCurrentToken( @Nonnull JsonParser parser, @Nonnull JsonToken expected ) throws JsonParseException {
    JsonToken current = parser.getCurrentToken();
    if ( current != expected ) {
      throw new JsonParseException( "Invalid token. Expected <" + expected + "> but got <" + current + ">", parser.getCurrentLocation() );
    }
  }
View Full Code Here

            return sb.toString();
        }

        public static void reportParseError(String errorMsg, JsonLocation jsonLoc) throws JsonParseException {

            throw new JsonParseException(errorMsg, jsonLoc);

        }
View Full Code Here

        current = parser.nextToken(); // move to value
        return parser.getText();
    }

    public static void reportParseError(String errorMsg, JsonLocation jsonLoc) throws JsonParseException {
        throw new JsonParseException(errorMsg, jsonLoc);
    }
View Full Code Here

      synchronized (dateFormat) {       
        return dateFormat.parse(parser.getText());
      }
    }
    catch (ParseException e) {
      throw new JsonParseException("Could not parse date", parser.getCurrentLocation(), e);
    }
  }
View Full Code Here

  }

  @Deprecated
  public static void ensureObjectClosed( @Nonnull JsonParser parser ) throws JsonParseException {
    if ( parser.getCurrentToken() != JsonToken.END_OBJECT ) {
      throw new JsonParseException( "No consumed everything " + parser.getCurrentToken(), parser.getCurrentLocation() );
    }
  }
View Full Code Here

  }

  @Deprecated
  public static void ensureParserClosed( @Nonnull JsonParser parser ) throws IOException {
    if ( parser.nextToken() != null ) {
      throw new JsonParseException( "No consumed everything " + parser.getCurrentToken(), parser.getCurrentLocation() );
    }

    parser.close();
  }
View Full Code Here

  public static void nextField( @Nonnull JsonParser parser, @Nonnull String fieldName ) throws IOException {
    nextToken( parser, JsonToken.FIELD_NAME );
    String currentName = parser.getCurrentName();

    if ( !fieldName.equals( currentName ) ) {
      throw new JsonParseException( "Invalid field. Expected <" + fieldName + "> but was <" + currentName + ">", parser.getCurrentLocation() );
    }
  }
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.JsonParseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.