Class RecordModelGenerator
Facilitates tasks of JSON generation for record models/data docs 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()
Assembly: Azos.Wave.dll
Syntax
public class RecordModelGenerator
Constructors
RecordModelGenerator()
Declaration
public RecordModelGenerator()
RecordModelGenerator(IConfigSectionNode)
Declaration
public RecordModelGenerator(IConfigSectionNode conf)
Parameters
Fields
Declaration
public const string METADATA_CONFIG_FIELD = "Config"
Field Value
Type |
Description |
System.String |
|
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
Methods
FieldDefToJSON(Doc, String, Schema.FieldDef, String, String, ModelFieldValueListLookupFunc)
Declaration
protected virtual JSONDataMap FieldDefToJSON(Doc doc, string schema, Schema.FieldDef fdef, string target, string isoLang, ModelFieldValueListLookupFunc valueListLookup)
Parameters
Returns
MapCLRCharCaseToJS(CharCase)
Declaration
protected virtual string MapCLRCharCaseToJS(CharCase kind)
Parameters
Returns
Type |
Description |
System.String |
|
MapCLRKindToJS(DataKind)
Declaration
protected virtual string MapCLRKindToJS(DataKind kind)
Parameters
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(Doc, 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(Doc doc, Exception validationError, string recID = null, string target = null, string isoLang = null, ModelFieldValueListLookupFunc valueListLookup = null)
Parameters
Type |
Name |
Description |
Doc |
doc |
|
System.Exception |
validationError |
|
System.String |
recID |
|
System.String |
target |
|
System.String |
isoLang |
|
ModelFieldValueListLookupFunc |
valueListLookup |
|
Returns
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
Extension Methods