Examples of verifyCurrentToken()


Examples of com.cedarsoft.serialization.jackson.JacksonParserWrapper.verifyCurrentToken()

  public Extension deserialize( @Nonnull JsonParser deserializeFrom, @Nonnull Version formatVersion )
    throws VersionException, IOException, JsonProcessingException {
    //delimiter
    JacksonParserWrapper parserWrapper = new JacksonParserWrapper( deserializeFrom );
    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    String currentName1 = parserWrapper.getCurrentName();

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

Examples of com.cedarsoft.serialization.jackson.JacksonParserWrapper.verifyCurrentToken()

    }
    parserWrapper.nextToken();
    String delimiter = parserWrapper.getText();
    //extension
    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    String currentName = parserWrapper.getCurrentName();

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

Examples of com.cedarsoft.serialization.jackson.JacksonParserWrapper.verifyCurrentToken()

  public VersionRange deserialize( @Nonnull JsonParser deserializeFrom, @Nonnull Version formatVersion )
    throws VersionException, IOException, JsonProcessingException {
    //min
    JacksonParserWrapper parserWrapper = new JacksonParserWrapper( deserializeFrom );
    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    String currentName3 = parserWrapper.getCurrentName();

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

Examples of com.cedarsoft.serialization.jackson.JacksonParserWrapper.verifyCurrentToken()

    }
    parserWrapper.nextToken();
    Version min = Version.parse( deserializeFrom.getText() );
    //max
    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    String currentName2 = parserWrapper.getCurrentName();

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

Examples of com.cedarsoft.serialization.jackson.JacksonParserWrapper.verifyCurrentToken()

    }
    parserWrapper.nextToken();
    Version max = Version.parse( deserializeFrom.getText() );
    //includeLower
    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    String currentName1 = parserWrapper.getCurrentName();

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

Examples of com.cedarsoft.serialization.jackson.JacksonParserWrapper.verifyCurrentToken()

    }
    parserWrapper.nextToken();
    boolean includeLower = deserializeFrom.getBooleanValue();
    //includeUpper
    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    String currentName = parserWrapper.getCurrentName();

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

Examples of com.cedarsoft.serialization.jackson.JacksonParserWrapper.verifyCurrentToken()

  public Color deserialize( @Nonnull JsonParser deserializeFrom, @Nonnull Version formatVersion ) throws IOException, VersionException, JsonProcessingException {
    assert isVersionReadable( formatVersion );
    //red
    JacksonParserWrapper parserWrapper = new JacksonParserWrapper( deserializeFrom );
    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    String currentName2 = parserWrapper.getCurrentName();

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

Examples of com.cedarsoft.serialization.jackson.JacksonParserWrapper.verifyCurrentToken()

    }
    parserWrapper.nextToken();
    int red = parserWrapper.getIntValue();

    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    String currentName1 = parserWrapper.getCurrentName();

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

Examples of com.cedarsoft.serialization.jackson.JacksonParserWrapper.verifyCurrentToken()

    }
    parserWrapper.nextToken();
    int green = parserWrapper.getIntValue();

    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    String currentName = parserWrapper.getCurrentName();

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

Examples of com.cedarsoft.serialization.jackson.JacksonParserWrapper.verifyCurrentToken()

  @Override
  public License deserialize( @Nonnull JsonParser deserializeFrom, @Nonnull Version formatVersion ) throws VersionException, IOException, JsonProcessingException {
    //If there is a subtype it *must* be cc
    JacksonParserWrapper parserWrapper = new JacksonParserWrapper( deserializeFrom );
    parserWrapper.nextToken();
    parserWrapper.verifyCurrentToken( JsonToken.FIELD_NAME );
    if ( deserializeFrom.getCurrentName().equals( PROPERTY_SUB_TYPE ) ) {
      parserWrapper.nextToken();
      parserWrapper.verifyCurrentToken( JsonToken.VALUE_STRING );
      String subType = deserializeFrom.getText();

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.