Examples of DocId


Examples of com.cedarsoft.couchdb.DocId

  @NotNull
  public <K, V, D> Row<K, V, D> deserialize( @NotNull JacksonSerializer<? super K> keySerializer, @NotNull JacksonSerializer<? super V> valueSerializer, @Nullable JacksonSerializer<? extends D> documentSerializer, @NotNull JsonParser parser ) throws IOException, InvalidTypeException {
    //The id
    AbstractJacksonSerializer.nextFieldValue( parser, PROPERTY_ID );
    DocId id = new DocId( parser.getText() );

    //The key
    AbstractJacksonSerializer.nextField( parser, PROPERTY_KEY );
    K key = ( K ) keySerializer.deserialize( parser );
View Full Code Here

Examples of com.cedarsoft.couchdb.DocId

    String rev = parser.getText();

    parser.nextToken();

    AbstractJacksonSerializer.ensureObjectClosed( parser );
    return new RawCouchDoc( new DocId( id ), new Revision( rev ) );
  }
View Full Code Here

Examples of com.cedarsoft.couchdb.DocId

    AbstractJacksonSerializer.nextFieldValue( deserializeFrom, PROPERTY_ID );
    String id = deserializeFrom.getText();
    AbstractJacksonSerializer.nextFieldValue( deserializeFrom, PROPERTY_REV );
    String rev = deserializeFrom.getText();
    AbstractJacksonSerializer.closeObject( deserializeFrom );
    return new ActionResponse( new DocId( id ), new Revision( rev ), status );

    //    AbstractJacksonSerializer.nextToken( deserializeFrom, JsonToken.FIELD_NAME );
    //    if ( deserializeFrom.getCurrentName().equals( PROPERTY_OK ) ) {
    //    } else {
    //      AbstractJacksonSerializer.nextToken( deserializeFrom, JsonToken.VALUE_STRING );
View Full Code Here

Examples of com.cedarsoft.couchdb.DocId

  @Nonnull
  public <K, V, D> Row<K, V, D> deserialize( @Nonnull JacksonSerializer<? super K> keySerializer, @Nonnull JacksonSerializer<? super V> valueSerializer, @Nullable JacksonSerializer<? extends D> documentSerializer, @Nonnull JsonParser parser ) throws IOException, InvalidTypeException {
    //The id
    AbstractJacksonSerializer.nextFieldValue( parser, PROPERTY_ID );
    DocId id = new DocId( parser.getText() );

    //The key
    AbstractJacksonSerializer.nextField( parser, PROPERTY_KEY );
    K key = ( K ) keySerializer.deserialize( parser );
View Full Code Here

Examples of com.cedarsoft.couchdb.DocId

  @Override
  protected void beforeTypeAndVersion( @Nonnull JacksonParserWrapper wrapper ) throws IOException, JsonProcessingException, InvalidTypeException {
    super.beforeTypeAndVersion( wrapper );

    wrapper.nextFieldValue( "_id" );
    final DocId id = new DocId( wrapper.getText() );
    wrapper.nextFieldValue( "_rev" );
    final Revision revision = new Revision( wrapper.getText() );

    current = new UniqueId( id, revision );
  }
View Full Code Here

Examples of com.cedarsoft.couchdb.core.DocId

    assert rev != null;
    assert id != null;

    parser.ensureObjectClosed();

    return new UniqueId( new DocId( id ), new Revision( rev ) );

    //    AbstractJacksonSerializer.nextToken( deserializeFrom, JsonToken.FIELD_NAME );
    //    if ( deserializeFrom.getCurrentName().equals( PROPERTY_OK ) ) {
    //    } else {
    //      AbstractJacksonSerializer.nextToken( deserializeFrom, JsonToken.VALUE_STRING );
View Full Code Here

Examples of com.cedarsoft.couchdb.core.DocId

    //the attachments - if there are any....
    List<? extends CouchDoc.Attachment> attachments = deserializeAttachments( parserWrapper );

    parserWrapper.ensureObjectClosed();
    CouchDoc<T> doc = new CouchDoc<>( new DocId( id ), rev == null ? null : new Revision( rev ), wrapped );
    doc.addAttachments( attachments );
    return doc;
  }
View Full Code Here

Examples of com.cedarsoft.couchdb.core.DocId

  }

  public <K, V, D> void serialize( @Nonnull Row<K, V, D> row, @Nonnull JacksonSerializer<? super K> keySerializer, @Nonnull JacksonSerializer<? super V> valueSerializer, @Nullable JacksonSerializer<? super D> documentSerializer, @Nonnull JsonGenerator generator ) throws IOException {
    generator.writeStartObject();

    @Nullable DocId id = row.getId();
    if ( id != null ) {
      generator.writeStringField( PROPERTY_ID, id.asString() );
    }

    //The key
    generator.writeFieldName( PROPERTY_KEY );
    keySerializer.serialize( row.getKey(), generator );
View Full Code Here

Examples of com.cedarsoft.couchdb.core.DocId

    JacksonParserWrapper wrapper = new JacksonParserWrapper( parser );
    wrapper.nextToken( JsonToken.FIELD_NAME );
    String fieldName = wrapper.getCurrentName();

    //The id
    @Nullable final DocId id;
    if ( fieldName.equals( PROPERTY_ID ) ) {
      wrapper.nextValue();
      id = new DocId( wrapper.getText() );
      wrapper.nextField( PROPERTY_KEY );
    }else {
      id = null;
    }
View Full Code Here

Examples of com.cedarsoft.couchdb.core.DocId

    String rev = parser.getText();

    parser.nextToken();

    parserWrapper.ensureObjectClosed();
    return new RawCouchDoc( new DocId( id ), new Revision( rev ) );
  }
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.