Root / Assembly / ARCCore / Class / PropertyStreamLineParsed / _Member / TryParse

ClassMemberAttribute

TryParse

KeyValue
DescriptionGenerate list of <(IK key, Type valueType)> together with value from value part.

Has very few fail-scenarios (that is will almost always return TRUE).
Note that the value itself will not be parsed (it is just returned in Value as a 'string?').

the valueType returned will always be an IP type.
(but null for last key in hierarchy).

This is the first step in parsing a PropertyStreamLine, typically used by more higher level methods like
-TryParseAndStore-,
TryParseDirectToIP,
TryParseDirectToProperty.

Note that if the value part consists of individual items, like in WholeCollection, each of these has to be decoded individually again by the calling method (by calling DecodeStringFromPropertyStreamFormat).

Details: For each key, decide which instance type of IK to use, that is, once of PK, IKType, IKString (or IKLong if an integer) in prioritized order).

The following priority is used for deciding IK-keys:
1) PK if a PK is recognized (like FirstName in 'Customer/42/FirstName:', based on a combination of found type 'Customer' and field 'FirstName')

2) IKType if a IP-derived type is recognized.
(like 'Customer' in 'Customer/42/FirstName:')

3) IKString for other cases (IKLong if an integer) .
(like 42 in 'Custome/42/FirstName:'

For each key, decide what type of value-object to create if no object exists for that key (dedicated type like 'Customer' if possible, if not PRich)

For 'Customer/42/FirstName = John', the tuple generated will look like this:
(which of the two alternative values are returned (IKType or IKString) depends on the actual type being known to the application (see AllIPDerivedTypes).
---------------------------------------------------------------------------------------------------------
key: valueType
Index 0 Customer IKType(typeof(Customer)) / IKString('Customer') PRich
Index 1 42 IKLong(42) (since integer, else IKString('42')) Customer / PRich
Index 2 FirstName PK (from CustomerP.FirstName) / IKString('FirstName') Null. Left to IP to decide at call to SetP.

For 'Customer/42/PhoneNumber/90534333' ('strange' syntax is related to IndividualItems),
the tuple generated will look like this:
(which of the two alternative values are returned (IKType or IKString) depends on the actual type being known to the application (see AllIPDerivedTypes).
---------------------------------------------------------------------------------------------------------
key: valueType
Index 0 Customer IKType(typeof(Customer)) / IKString('Customer') PRich
Index 1 42 IKLong(42) (since integer, else IKString('42')) Customer / PRich
Index 2 PhoneNumber PK (from CustomerP.PhoneNumber) / IKString('PhoneNumber') Null. Left to IP to decide at call to SetP.

Note that more complex representations like:
Customer/42/Car/1/Colour = Red
is also understood.
So if CustomerP.Car exists then for 'Car' that corresponding PK will be used, while for '1' the type to create will be the the PK's Type.

The above would be relevant for cardinality IndividualItems for CustomerP.Car).
For cardinality HistoryOnly, as in
Customer/42/Car/Colour = Red
then for 'Car' the corresponding CustomerP.Car will be used (as above), and for Colour the corresponding PK for CarP.Colour.
MethodNameTryParse
MethodSignatureBoolean TryParse(System.String, ARCCore.PropertyStreamLineParsed ByRef, System.String ByRef)
ReflectedTypeARCCore.PropertyStreamLineParsed

4 items


Generated 2020-10-13 11:11:05.209 UTC