Examples of JacksonParserWrapper


Examples of com.cedarsoft.serialization.jackson.JacksonParserWrapper

  @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

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

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

   * @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

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

  @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

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

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

    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

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 );

      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
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.