/// <summary> /// Creates a raw entry parser using an initialisation string to create thelinks. Valid link names are: /// N (null) - A (all) - F (Validator) - L (LegacyV1) - T (FormattedV2). Use RawEntryParserChain.CONSTNAME to get values. /// </summary> /// <param name="chainInitialisationString">The string to create the chain with</param> /// <param name="oidProvider">An identity provider</param> /// <returns>A valid raw entry parsing chain</returns> internal static RawEntryParserChain CreateChain(string chainInitialisationString, IOriginIdentityProvider oidProvider) { #region entry code if (string.IsNullOrEmpty(chainInitialisationString)) { throw new ArgumentException(chainInitialisationString, "The initialisation string passed to the Parser chain must specify at least one link."); } //Bilge b = new Bilge(); //b.Assert.True(chainInitialisationString.IndexOf('F') <= 0, "When a filter is included in the chain it must be included as the first element in the chain.", "Actual " + chainInitialisationString + " \r\n Expected: F" + chainInitialisationString); #endregion RawEntryParserChain result = new RawEntryParserChain(); RawEntryParserChainLink links = null; result.identityProvider = oidProvider; links = GetParserLinkByCharacterIdentity(chainInitialisationString[0], oidProvider); result.ActiveChain = links; for (int i = 1; i < chainInitialisationString.Length; i++) { links.SetLink(GetParserLinkByCharacterIdentity(chainInitialisationString[i], oidProvider)); links = links.nextLink; } return(result); }
public DataParser(IOriginIdentityProvider iop, RawEntryParserChain chn, IRecieveEvents reciever) { if (reciever == null) { throw new InvalidOperationException("The reciever can not be null, the DataParser can not parse entries into a null reciever"); } outwardBound = reciever; chain = chn; originID = iop; }