Beispiel #1
0
        public string GetOutput(IInputRecord rec)
        {
            if (string.IsNullOrEmpty(this.InputSelector))
            {
                throw new FormatikException("InputSelector not specified");
            }

            return($"{Prefix}{rec.GetToken(this.InputSelector)}{Suffix}");
        }
Beispiel #2
0
        protected TokenValue(IInputRecord record)
        {
            if (record == null)
            {
                throw new ArgumentNullException("record");
            }

            this.Record = record;
        }
Beispiel #3
0
        public TokenValue(string value, IInputRecord record, Token token)
        {
            if (record == null)
            {
                throw new ArgumentNullException("record");
            }

            this.Value  = value;
            this.Record = record;
            this.Token  = token;
        }
Beispiel #4
0
        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;
        }
Beispiel #5
0
        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;
        }
Beispiel #6
0
 public BsonToken(IInputRecord sampleRecord, string sampleValue, string inputSelector, int inputIndex)
 {
     Token = new Token(sampleRecord, sampleValue, inputSelector, inputIndex);
 }