Package com.cedarsoft.serialization.jackson.test.compatible

Examples of com.cedarsoft.serialization.jackson.test.compatible.JacksonParserWrapper


  }

  @Override
  @Nonnull
  public T deserialize( @Nonnull JsonParser parser ) throws IOException, JsonProcessingException, InvalidTypeException {
    JacksonParserWrapper wrapper = new JacksonParserWrapper( parser );

    Version version;
    if ( isObjectType() ) {
      wrapper.nextToken( JsonToken.START_OBJECT );

      wrapper.nextFieldValue( PROPERTY_TYPE );
      String readNs = parser.getText();
      verifyType( readNs );
      wrapper.nextFieldValue( PROPERTY_VERSION );
      version = Version.parse( parser.getText() );
      verifyVersionReadable( version );
    } else {
      parser.nextToken();
      version = getFormatVersion();
View Full Code Here


   * @throws JsonProcessingException
   * @throws InvalidTypeException
   */
  @Nonnull
  protected T deserializeInternal( @Nonnull JsonParser parser, @Nullable Version formatVersionOverride ) throws IOException, JsonProcessingException, InvalidTypeException {
    JacksonParserWrapper wrapper = new JacksonParserWrapper( parser );

    Version version = prepareDeserialization( wrapper, formatVersionOverride );

    T deserialized = deserialize( parser, version );

View Full Code Here

  @Nonnull
  @Override
  public URL deserialize( @Nonnull JsonParser deserializeFrom, @Nonnull Version formatVersion ) throws VersionException, IOException, JsonProcessingException {
    verifyVersionReadable( formatVersion );
    JacksonParserWrapper parser = new JacksonParserWrapper( deserializeFrom );

    final String text = parser.getText();
    return new URL( text );
  }
View Full Code Here

  }

  @Override
  @Nonnull
  public T deserialize( @Nonnull JsonParser parser ) throws IOException, JsonProcessingException, InvalidTypeException {
    JacksonParserWrapper wrapper = new JacksonParserWrapper( parser );

    Version version;
    if ( isObjectType() ) {
      wrapper.nextToken( JsonToken.START_OBJECT );

      wrapper.nextFieldValue( PROPERTY_TYPE );
      String readNs = parser.getText();
      verifyType( readNs );
      wrapper.nextFieldValue( PROPERTY_VERSION );
      version = Version.parse( parser.getText() );
      verifyVersionReadable( version );
    } else {
      parser.nextToken();
      version = getFormatVersion();
View Full Code Here

    JsonFactory jsonFactory = JacksonSupport.getJsonFactory();
    InputStream entityInputStream = response.getEntityInputStream();
    try {
      JsonParser parser = jsonFactory.createJsonParser( entityInputStream );
      JacksonParserWrapper wrapper = new JacksonParserWrapper( parser );

      wrapper.nextToken( JsonToken.START_OBJECT );

      wrapper.nextFieldValue( "_id" );
      wrapper.nextFieldValue( "_rev" );
      return new Revision( wrapper.getText() );
    } finally {
      entityInputStream.close();
    }
  }
View Full Code Here

  }

  @Override
  @Nonnull
  public T deserialize( @Nonnull JsonParser parser ) throws IOException, JsonProcessingException, InvalidTypeException {
    JacksonParserWrapper wrapper = new JacksonParserWrapper( parser );

    Version version;
    if ( isObjectType() ) {
      wrapper.nextToken( JsonToken.START_OBJECT );

      beforeTypeAndVersion( wrapper );

      wrapper.nextFieldValue( PROPERTY_TYPE );
      String readType = parser.getText();
      verifyType( readType );
      wrapper.nextFieldValue( PROPERTY_VERSION );
      version = Version.parse( parser.getText() );
      verifyVersionReadable( version );
    } else {
      parser.nextToken();
      version = getFormatVersion();
View Full Code Here

TOP

Related Classes of com.cedarsoft.serialization.jackson.test.compatible.JacksonParserWrapper

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.