Show / Hide Table of Contents

Class PortableObjectDocument

Represents an graph of arbitrary CLR objects as a graph of well known POD-objects which are based on primitive-only types. This class acts as a Document-Object-Model container that hosts comlex CLR types that may change their structure but need to be deserialized even if deserialization is partial / requires transform

Inheritance
System.Object
PortableObjectDocument
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX.Serialization.POD
Assembly: NFX.dll
Syntax
[Serializable]
public sealed class PortableObjectDocument

Constructors

PortableObjectDocument(Object, Nullable<DateTime>, String)

Creates a new instance of object document from the graph of arbitrary CLR objects serializing them into well-known POD object types

Declaration
public PortableObjectDocument(object graph, DateTime? creationDate = default (DateTime? ), string notes = null)
Parameters
Type Name Description
System.Object graph
System.Nullable<System.DateTime> creationDate
System.String notes

Properties

BuildInformation

Returns build information for framework that contains the PortableObjectDocuemnt type

Declaration
public BuildInformation BuildInformation { get; }
Property Value
Type Description
BuildInformation

CreationDate

Returns timestamp when this doc was created

Declaration
public DateTime CreationDate { get; }
Property Value
Type Description
System.DateTime

MetaTypes

Returns meta types that this document contains

Declaration
public IEnumerable<MetaType> MetaTypes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<MetaType>

Notes

Returns notes supplied when document was created

Declaration
public string Notes { get; }
Property Value
Type Description
System.String

Root

Returns graph root potable object that this document represents, not a native object

Declaration
public object Root { get; }
Property Value
Type Description
System.Object

RootMetaType

Returns graph root object meta type index, if root is null them MetaCompositeType(Object) is returned

Declaration
public MetaType RootMetaType { get; }
Property Value
Type Description
MetaType

RootMetaTypeIndex

Returns graph root object meta type index, if root data is null then 0 is returned which is an index of MetaCompositeType(Object) type

Declaration
public int RootMetaTypeIndex { get; }
Property Value
Type Description
System.Int32

Methods

GetExistingOrNewMetaType(Type)

Obtains new or existing MetaType instance that represents a Type in this document instance. If this document instance already has this type registered, then existing MetaType instance is returned, otherwise the new MetaType instance that represents the supplied CLR Type is created and registered under the document-unique index

Declaration
public MetaType GetExistingOrNewMetaType(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
MetaType

GetExistingOrNewMetaTypeIndex(Type)

Obtains new or existing index of MetaType that represents a Type in this document instance. If this document instance already has this type registered, then existing index is returned, otherwise the new MetaType instance that represents the supplied CLR Type is created and registered under the document-unique index

Declaration
public int GetExistingOrNewMetaTypeIndex(Type type)
Parameters
Type Name Description
System.Type type
Returns
Type Description
System.Int32

GetMetaTypeFromIndex(Int32)

Returns MetaType by index

Declaration
public MetaType GetMetaTypeFromIndex(int index)
Parameters
Type Name Description
System.Int32 index
Returns
Type Description
MetaType

NativeDataToPortableData(Object)

Transforms a native value, such as object, primitive, struct etc.. into a value that can be stored in the PortableObjectDocument. The complex types are stored as CompositeData, primitives are stored as-is (boxed)

Declaration
public object NativeDataToPortableData(object data)
Parameters
Type Name Description
System.Object data
Returns
Type Description
System.Object

PortableDataToNativeData(ReadingStrategy, Object)

Transforms a portable data value, such as object, primitive, struct etc.. into a CLR

Declaration
public object PortableDataToNativeData(ReadingStrategy strategy, object data)
Parameters
Type Name Description
ReadingStrategy strategy
System.Object data
Returns
Type Description
System.Object

ToOriginalObject(ReadingStrategy)

Deserializes PortableObjectDocument into original graph of arbitrary CLR objects trying to preserve/convert as much data as possible using optionally supplied strategy

Declaration
public object ToOriginalObject(ReadingStrategy strategy = null)
Parameters
Type Name Description
ReadingStrategy strategy
Returns
Type Description
System.Object

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX