Share via


ObjectInputStream.RegisterValidation(IObjectInputValidation, Int32) Method

Definition

Register an object to be validated before the graph is returned.

[Android.Runtime.Register("registerValidation", "(Ljava/io/ObjectInputValidation;I)V", "GetRegisterValidation_Ljava_io_ObjectInputValidation_IHandler")]
public virtual void RegisterValidation (Java.IO.IObjectInputValidation? obj, int prio);
[<Android.Runtime.Register("registerValidation", "(Ljava/io/ObjectInputValidation;I)V", "GetRegisterValidation_Ljava_io_ObjectInputValidation_IHandler")>]
abstract member RegisterValidation : Java.IO.IObjectInputValidation * int -> unit
override this.RegisterValidation : Java.IO.IObjectInputValidation * int -> unit

Parameters

obj
IObjectInputValidation

the object to receive the validation callback.

prio
Int32

controls the order of callbacks;zero is a good default. Use higher numbers to be called back earlier, lower numbers for later callbacks. Within a priority, callbacks are processed in no particular order.

Attributes

Exceptions

if object is null.

if this stream is currently not reading objects. In that case, calling this method is not allowed.

Remarks

Register an object to be validated before the graph is returned. While similar to resolveObject these validations are called after the entire graph has been reconstituted. Typically, a readObject method will register the object with the stream so that when all of the objects are restored a final set of validations can be performed.

Java documentation for java.io.ObjectInputStream.registerValidation(java.io.ObjectInputValidation, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also