Diffusion .NET Classic API - Core and Common  5.9.4
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl Class Referenceabstract

Base implementation of MField - subclassed for specific data types. More...

Inheritance diagram for PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl:
PushTechnology.DiffusionCore.Messaging.Data.metadata.MNodeImpl PushTechnology.DiffusionCore.Messaging.Data.metadata.IMField PushTechnology.DiffusionCore.Messaging.Data.metadata.IMNode PushTechnology.DiffusionCore.Messaging.Data.metadata.IMNode PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldCustomString PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldDecimalString PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldIntegerString PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldString

Public Member Functions

abstract object Parse (object obj)
 Parses any object that can be parsed into the internal representation of this field's data type. More...
 
abstract bool AreEqual (object source, object target)
 Compares two objects for equality, assuming that they are already of the value of this data type (i.e. parsed). More...
 
void SetDefaultValue (object value)
 Sets a default value that required occurrences of the field are to be initialised to. More...
 

Protected Member Functions

 MFieldImpl (string name, MDataType dataType, MRecordImpl parent, Multiplicity multiplicity)
 Constructor. More...
 
void SetInitialDefaultValue (object value)
 Used for setting the default value at the start. More...
 

Properties

override bool IsField [get, set]
 Get/set whether this is a field. More...
 
override bool IsRecord [get, set]
 Get/set whether this is a record. More...
 
override bool IsMessage [get, set]
 Get/set whether this is a message. More...
 
abstract object InitialDefaultValue [get, set]
 Get initial default value for data type. More...
 
MDataType DataType [get, set]
 Returns the data type of the field. More...
 
object DefaultValue [get, set]
 Returns the default value that the field should be initialised to. Returns a non-null value used to initialise required fields. The type of the returned object will be the internal representation type for the data type. More...
 
int Scale [get, set]
 Gets/sets the scale of the field. More...
 
bool AllowsEmpty [get, set]
 Indicates whether the field allows an empty value when parsed from string input. More...
 
ICustomFieldHandler CustomFieldHandler [get, set]
 If the data type is CustomString, then this will return the custom string handler. More...
 

Detailed Description

Base implementation of MField - subclassed for specific data types.

Constructor & Destructor Documentation

PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.MFieldImpl ( string  name,
MDataType  dataType,
MRecordImpl  parent,
Multiplicity  multiplicity 
)
protected

Constructor.

Parameters
name
dataType
parent
multiplicity

Member Function Documentation

abstract bool PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.AreEqual ( object  source,
object  target 
)
pure virtual

Compares two objects for equality, assuming that they are already of the value of this data type (i.e. parsed).

Parameters
source
target
Returns
true if equal, or false if not equal (or either parameter not of the correct type.

Implemented in PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldDecimalString, PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldIntegerString, PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldCustomString, and PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldString.

abstract object PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.Parse ( object  obj)
pure virtual

Parses any object that can be parsed into the internal representation of this field's data type.

Parameters
objA value to parse - if null is supplied then the default value should be returned.
Returns

Implemented in PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldCustomString, PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldDecimalString, PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldIntegerString, and PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldString.

void PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.SetDefaultValue ( object  value)

Sets a default value that required occurrences of the field are to be initialised to.

Parameters
valueAn initial value - the object specified will be parsed into the internal type representation for the data type.

Implements PushTechnology.DiffusionCore.Messaging.Data.metadata.IMField.

void PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.SetInitialDefaultValue ( object  value)
protected

Used for setting the default value at the start.

Parameters
value

Property Documentation

bool PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.AllowsEmpty
getset

Indicates whether the field allows an empty value when parsed from string input.

By default, MDataType.String type fields allow empty input but other types do not. This may be used to change this default behaviour.

When a field allows empty input and an empty (zero length string) is parsed, then its internal representation will be a zero-length string and not an object of the default type for the field.

ICustomFieldHandler PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.CustomFieldHandler
getset

If the data type is CustomString, then this will return the custom string handler.

Returns the custom string handler, or null if this is not a custom type.

MDataType PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.DataType
getset

Returns the data type of the field.

object PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.DefaultValue
getset

Returns the default value that the field should be initialised to. Returns a non-null value used to initialise required fields. The type of the returned object will be the internal representation type for the data type.

Returns
abstract object PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.InitialDefaultValue
getset

Get initial default value for data type.

override bool PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.IsField
getset

Get/set whether this is a field.

override bool PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.IsMessage
getset

Get/set whether this is a message.

override bool PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.IsRecord
getset

Get/set whether this is a record.

int PushTechnology.DiffusionCore.Messaging.Data.metadata.MFieldImpl.Scale
getset

Gets/sets the scale of the field.

The scale is the number of digits to the right of the decimal point for a field of type DecimalString. For non-decimal data types this value is ignored.

When not explicitly set, a value of 2 is assumed.