public string GetOutput(IInputRecord rec) { if (string.IsNullOrEmpty(this.InputSelector)) { throw new FormatikException("InputSelector not specified"); } return($"{Prefix}{rec.GetToken(this.InputSelector)}{Suffix}"); }
protected TokenValue(IInputRecord record) { if (record == null) { throw new ArgumentNullException("record"); } this.Record = record; }
public TokenValue(string value, IInputRecord record, Token token) { if (record == null) { throw new ArgumentNullException("record"); } this.Value = value; this.Record = record; this.Token = token; }
public Token(IInputRecord sampleRecord, string sampleValue, string inputSelector, int inputIndex) { if (sampleRecord == null) { throw new ArgumentNullException("sampleRecord"); } this.Values = new TokenValue[] { new TokenValue(sampleValue, sampleRecord, this) }; this.InputSelector = inputSelector; this.InputIndex = inputIndex; }
public TokenValue(Token token) { if (token == null) { throw new ArgumentNullException("token"); } if (!token.Values.Any()) { throw new ArgumentException("token does not contain any sample values"); } var firstSample = token.Values.First(); this.Value = firstSample.Value; this.Record = firstSample.Record; }
public BsonToken(IInputRecord sampleRecord, string sampleValue, string inputSelector, int inputIndex) { Token = new Token(sampleRecord, sampleValue, inputSelector, inputIndex); }