Show / Hide Table of Contents

Class PofStreamReader.UserTypeReader

The UserTypeReader implementation is a contextually-aware IPofReader whose purpose is to advance through the properties of a value of a specified user type.

Inheritance
object
PofStreamReader
PofStreamReader.UserTypeReader
Implements
IPofReader
Inherited Members
PofStreamReader.PofContext
PofStreamReader.ReadBoolean(int)
PofStreamReader.ReadByte(int)
PofStreamReader.ReadChar(int)
PofStreamReader.ReadInt16(int)
PofStreamReader.ReadInt32(int)
PofStreamReader.ReadInt64(int)
PofStreamReader.ReadRawInt128(int)
PofStreamReader.ReadSingle(int)
PofStreamReader.ReadDouble(int)
PofStreamReader.ReadBooleanArray(int)
PofStreamReader.ReadByteArray(int)
PofStreamReader.ReadCharArray(int)
PofStreamReader.ReadInt16Array(int)
PofStreamReader.ReadInt32Array(int)
PofStreamReader.ReadInt64Array(int)
PofStreamReader.ReadSingleArray(int)
PofStreamReader.ReadDoubleArray(int)
PofStreamReader.ReadDecimal(int)
PofStreamReader.ReadString(int)
PofStreamReader.ReadDateTime(int)
PofStreamReader.ReadLocalDateTime(int)
PofStreamReader.ReadUniversalDateTime(int)
PofStreamReader.ReadRawDateTime(int)
PofStreamReader.ReadDate(int)
PofStreamReader.ReadRawTime(int)
PofStreamReader.ReadRawYearMonthInterval(int)
PofStreamReader.ReadTimeInterval(int)
PofStreamReader.ReadDayTimeInterval(int)
PofStreamReader.ReadObject(int)
PofStreamReader.ReadBinary(int)
PofStreamReader.ReadArray(int)
PofStreamReader.ReadArray(int, Array)
PofStreamReader.ReadLongArray(int, ILongArray)
PofStreamReader.ReadCollection(int, ICollection)
PofStreamReader.ReadDictionary(int, IDictionary)
PofStreamReader.ReadCollection<T>(int, ICollection<T>)
PofStreamReader.ReadDictionary<TKey, TValue>(int, IDictionary<TKey, TValue>)
PofStreamReader.EnsureReferenceRegistry()
PofStreamReader.RegisterIdentity(int, object)
PofStreamReader.LookupIdentity(int)
PofStreamReader.ReadAsObject(int)
PofStreamReader.ReadAsUniformObject(int)
PofStreamReader.ReadAsArray(int, Array)
PofStreamReader.ReadBinary(DataReader)
PofStreamReader.m_reader
PofStreamReader.m_ctx
PofStreamReader.m_referenceMap
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Tangosol.IO.Pof
Assembly: Coherence.dll
Syntax
public class PofStreamReader.UserTypeReader : PofStreamReader, IPofReader
Remarks

The "contextual awareness" refers to the fact that the UserTypeReader maintains state about the type identifier and version of the user type, the parser's property index position within the user type value, and a IPofContext that may differ from the IPofContext that provided the IPofSerializer which is using this UserTypeReader to parse a user type.

Constructors

UserTypeReader(DataReader, IPofContext, int, int)

Construct a parser for parsing the property values of a user type.

Declaration
public UserTypeReader(DataReader reader, IPofContext ctx, int typeId, int versionId)
Parameters
Type Name Description
DataReader reader

The DataReader that contains the user type data, except for the user type id itself (which is passed as a constructor argument).

IPofContext ctx

The IPofContext to use for parsing the user type property values within the user type that this parser will be parsing.

int typeId

The type id of the user type.

int versionId

The version id of the user type.

Exceptions
Type Condition
IOException

If an I/O error occurs.

UserTypeReader(PofStreamReader, DataReader, IPofContext, int, int)

Construct a parser for parsing the property values of a user type.

Declaration
public UserTypeReader(PofStreamReader parent, DataReader reader, IPofContext ctx, int typeId, int versionId)
Parameters
Type Name Description
PofStreamReader parent

The parent PofStreamReader (ie the containing) PofBufferReader

DataReader reader

The DataReader that contains the user type data, except for the user type id itself (which is passed as a constructor argument).

IPofContext ctx

The IPofContext to use for parsing the user type property values within the user type that this parser will be parsing.

int typeId

The type id of the user type.

int versionId

The version id of the user type.

Exceptions
Type Condition
IOException

If an I/O error occurs.

Properties

NextPropertyIndex

Return the index of the next property in the POF stream.

Declaration
public int NextPropertyIndex { get; }
Property Value
Type Description
int

ParentParser

If this parser is contextually within a user type, obtain the parser which created this parser in order to parse the user type.

Declaration
protected override PofStreamReader ParentParser { get; }
Property Value
Type Description
PofStreamReader

The parser for the context within which this parser is operating.

Overrides
PofStreamReader.ParentParser

PreviousPropertyIndex

Return the index of the most recent property read or (if it were missing) requested.

Declaration
public int PreviousPropertyIndex { get; }
Property Value
Type Description
int

UserTypeId

Gets the user type that is currently being parsed.

Declaration
public override int UserTypeId { get; }
Property Value
Type Description
int

The user type information, or -1 if the PofStreamReader is not currently parsing a user type.

Overrides
PofStreamReader.UserTypeId

VersionId

Gets the version identifier of the user type that is currently being parsed.

Declaration
public override int VersionId { get; }
Property Value
Type Description
int

The integer version ID read from the POF stream; always non-negative.

Overrides
PofStreamReader.VersionId
Exceptions
Type Condition
InvalidOperationException

If no user type is being parsed.

Methods

AdvanceTo(int)

Advance through the POF stream until the specified property is found.

Declaration
protected override bool AdvanceTo(int index)
Parameters
Type Name Description
int index

The index of the property to advance to.

Returns
Type Description
bool

true if the property is found.

Overrides
PofStreamReader.AdvanceTo(int)
Remarks

If the property is found, return true, otherwise return false and advance to the first property that follows the specified property.

Exceptions
Type Condition
InvalidOperationException

If the POF stream has already advanced past the desired property.

IOException

If an I/O error occurs.

CloseNested()

Notify the UserTypeReader that it is being "closed".

Declaration
protected void CloseNested()
Exceptions
Type Condition
NotSupportedException

throws IOException if an I/O error occurs

Complete(int)

Register the completion of the parsing of a value.

Declaration
protected override void Complete(int index)
Parameters
Type Name Description
int index

The property index.

Overrides
PofStreamReader.Complete(int)
Exceptions
Type Condition
IOException

If an I/O error occurs.

CreateNestedPofReader(int)

Obtain a PofReader that can be used to read a set of properties from a single property of the current user type. The returned PofReader is only valid from the time that it is returned until the next call is made to this PofReader.

Declaration
public override IPofReader CreateNestedPofReader(int iProp)
Parameters
Type Name Description
int iProp

the property index to read from

Returns
Type Description
IPofReader

a PofReader that reads its contents from a single property of this PofReader

Overrides
PofStreamReader.CreateNestedPofReader(int)
Exceptions
Type Condition
InvalidOperationException

If the POF stream has already advanced past the desired property, or if no user type is being parsed.

IOException

if an I/O error occurs

ReadRemainder()

Read all remaining indexed properties of the current user type from the POF stream.

Declaration
public override Binary ReadRemainder()
Returns
Type Description
Binary

A Binary containing zero or more indexed properties in binary POF encoded form.

Overrides
PofStreamReader.ReadRemainder()
Remarks

As part of reading in a user type, this method must be called by the IPofSerializer that is reading the user type, or the read position within the POF stream will be corrupted. Subsequent calls to the various ReadXYZ methods of this interface will fail after this method is called.

Exceptions
Type Condition
InvalidOperationException

If no user type is being parsed.

IOException

If an I/O error occurs.

RegisterIdentity(object)

Register an identity for a newly created user type instance.

If identity/reference types are enabled, an identity is used to uniquely identify a user type instance within a POF stream. The identity immediately proceeds the instance value in the POF stream and can be used later in the stream to reference the instance.

IPofSerializer implementations must call this method with each user type instance instantiated during deserialization prior to reading any properties of the instance which are user type instances themselves.
Declaration
public override void RegisterIdentity(object o)
Parameters
Type Name Description
object o

The object to register the identity for.

Overrides
PofStreamReader.RegisterIdentity(object)

Implements

IPofReader
In this article
Back to top Copyright © 2000, 2024, Oracle and/or its affiliates.