Couchbase Lite
Objective-C API for iOS and Mac OS
<CBLValidationContext > Protocol Reference

Detailed Description

Context passed into a CBLValidationBlock.

Inheritance diagram for <CBLValidationContext >:

Instance Methods

(void) - reject
 Rejects the proposed new revision. More...
 
(void) - rejectWithMessage:
 Rejects the proposed new revision. More...
 
() - CBLArrayOf
 Returns an array of all the keys whose values are different between the current and new revisions. More...
 
(BOOL) - validateChanges:
 Calls the 'enumerator' block for each key that's changed, passing both the old and new values. More...
 

Properties

CBLSavedRevisioncurrentRevision
 The contents of the current revision of the document, or nil if this is a new document. More...
 
NSURL * source
 The source of the change: either the URL of the remote database that's being pulled from, or a "user:" URL denoting the user authenticated through the listener's REST API, or nil. More...
 

Method Documentation

◆ reject()

- (void CBLValidationContext) reject

Rejects the proposed new revision.

◆ rejectWithMessage:()

- (void CBLValidationContext) rejectWithMessage: (NSString *)  message

Rejects the proposed new revision.

Any resulting error will contain the provided message; for example, if the change came from an external HTTP request, the message will be in the response status line. The default message is "invalid document".

◆ CBLArrayOf()

- (CBLValidationContext) CBLArrayOf (NSString *) 

Returns an array of all the keys whose values are different between the current and new revisions.

◆ validateChanges:()

- (BOOL CBLValidationContext) validateChanges: (CBLChangeEnumeratorBlock enumerator

Calls the 'enumerator' block for each key that's changed, passing both the old and new values.

If the block returns NO, the enumeration stops and rejects the revision, and the method returns NO; else the method returns YES.

Property Documentation

◆ currentRevision

- (CBLSavedRevision* CBLValidationContext) currentRevision
readatomicassign

The contents of the current revision of the document, or nil if this is a new document.

◆ source

- (NSURL* CBLValidationContext) source
readnonatomicassign

The source of the change: either the URL of the remote database that's being pulled from, or a "user:" URL denoting the user authenticated through the listener's REST API, or nil.


The documentation for this protocol was generated from the following file: