Show / Hide Table of Contents

Class RecordModelGenerator

Facilitates tasks of JSON generation for record models/rows as needed by WV.RecordModel client library. This class does not generate nested models, only flat models for particular row (i.e. id row has a complex type field, it will be serialized as "object")

Inheritance
System.Object
RecordModelGenerator
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.Wave.Client
Assembly: NFX.Wave.dll
Syntax
public class RecordModelGenerator

Constructors

RecordModelGenerator()

Declaration
public RecordModelGenerator()

RecordModelGenerator(IConfigSectionNode)

Declaration
public RecordModelGenerator(IConfigSectionNode conf)
Parameters
Type Name Description
IConfigSectionNode conf

Fields

METADATA_CONFIG_FIELD

Declaration
public const string METADATA_CONFIG_FIELD = "Config"
Field Value
Type Description
System.String

METADATA_FIELDS

Declaration
public static readonly HashSet<string> METADATA_FIELDS
Field Value
Type Description
System.Collections.Generic.HashSet<System.String>

Properties

DefaultInstance

Returns Default instance for simple use-cases

Declaration
public static RecordModelGenerator DefaultInstance { get; }
Property Value
Type Description
RecordModelGenerator

Methods

FieldDefToJSON(Row, String, Schema.FieldDef, String, String, ModelFieldValueListLookupFunc)

Declaration
protected virtual JSONDataMap FieldDefToJSON(Row row, string schema, Schema.FieldDef fdef, string target, string isoLang, ModelFieldValueListLookupFunc valueListLookup)
Parameters
Type Name Description
Row row
System.String schema
Schema.FieldDef fdef
System.String target
System.String isoLang
ModelFieldValueListLookupFunc valueListLookup
Returns
Type Description
JSONDataMap

MapCLRCharCaseToJS(CharCase)

Declaration
protected virtual string MapCLRCharCaseToJS(CharCase kind)
Parameters
Type Name Description
CharCase kind
Returns
Type Description
System.String

MapCLRKindToJS(DataKind)

Declaration
protected virtual string MapCLRKindToJS(DataKind kind)
Parameters
Type Name Description
DataKind kind
Returns
Type Description
System.String

MapCLRTypeToJS(Type)

Declaration
protected virtual string MapCLRTypeToJS(Type tp)
Parameters
Type Name Description
System.Type tp
Returns
Type Description
System.String

OnLocalizeString(String, String, String, String)

Declaration
protected virtual string OnLocalizeString(string schema, string prop, string value, string isoLang)
Parameters
Type Name Description
System.String schema
System.String prop
System.String value
System.String isoLang
Returns
Type Description
System.String

RowToRecordInitJSON(Row, Exception, String, String, String, ModelFieldValueListLookupFunc)

Generates JSON object suitable for passing into WV.RecordModel.Record(...) constructor on the client. Pass target to select attributes targeted to ANY target or to the specified one, for example may get attributes for client data entry screen that sees field metadata differently, in which case target will reflect the name of the screen

Declaration
public virtual JSONDataMap RowToRecordInitJSON(Row row, Exception validationError, string recID = null, string target = null, string isoLang = null, ModelFieldValueListLookupFunc valueListLookup = null)
Parameters
Type Name Description
Row row
System.Exception validationError
System.String recID
System.String target
System.String isoLang
ModelFieldValueListLookupFunc valueListLookup
Returns
Type Description
JSONDataMap

Events

ModelLocalization

Allows localization framework to install hook so that values can get translated per user-selected culture. The hook functor has the following signature: (string propertyName, string propValue): string. Returns translated propValue.

Declaration
public event ModelLocalizationEventHandler ModelLocalization
Event Type
Type Description
ModelLocalizationEventHandler

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