public IFieldMapper Parse(JobParser parser, ParseState state) { var splitter = parser.ParseSplitter(state.Select("Splitter") ?? state); return(new SplittingFieldMapper(splitter, postfix => state.Postfix(postfix).SelectMany("Fields").Select(parser.ParseFieldMapper).ToArray() )); }
IDataFilter IParseFactory <IDataFilter> .Parse(JobParser parser, ParseState state) { var splitter = parser.ParseSplitter(state.Select("Splitter") ?? state); var filter = splitter as IDataFilter; if (filter == null) { throw new Exception(filter.GetType().Name + " does not implement IDataFilter"); } return(filter); }
ITableMapper IParseFactory <ITableMapper> .Parse(JobParser parser, ParseState state) { var splitter = parser.ParseSplitter(state.Select("Splitter") ?? state); return(new SplittingTableMapper(splitter, name => parser.ParseTableMapper(state.Postfix(name).Select("Table", true)))); }