Exemplo n.º 1
0
        public static List <IAccessNumberParser> GetParsers(ParserFormatList lstFormat)
        {
            List <IAccessNumberParser> result = new List <IAccessNumberParser>();

            if (null != lstFormat && lstFormat.Count > 0)
            {
                List <IAccessNumberParser> parsers = lstFormat.ConvertAll(m => (IAccessNumberParser) new AccessNumberParser(m));

                parsers.ForEach(p => result.Add(new NoExceptionAccessNumberParser(p)));

                result.Add(new AutoAccessNumberParser(parsers));
            }
            else
            {
                result.Add(DefaultAccessNumberParser.GetInstance());
            }

            return(result);
        }
    public static List<IAccessNumberParser> GetParsers(ParserFormatList lstFormat)
    {
      List<IAccessNumberParser> result = new List<IAccessNumberParser>();

      if (null != lstFormat && lstFormat.Count > 0)
      {
        List<IAccessNumberParser> parsers = lstFormat.ConvertAll(m => (IAccessNumberParser)new AccessNumberParser(m));

        parsers.ForEach(p => result.Add(new NoExceptionAccessNumberParser(p)));

        result.Add(new AutoAccessNumberParser(parsers));
      }
      else
      {
        result.Add(DefaultAccessNumberParser.GetInstance());
      }

      return result;
    }
        public static List <ITitleParser> GetTitleParsers()
        {
            List <ITitleParser> result = new List <ITitleParser>();

            ParserFormatList lstFormat = ParserFormatList.ReadFromOptionFile("TITLElineParseDefinitions");

            if (null != lstFormat)
            {
                List <ITitleParser> parsers = lstFormat.ConvertAll(format => (ITitleParser)(new TitleParser(format)));

                DefaultTitleParser auto = new DefaultTitleParser(parsers);

                result = new List <ITitleParser>(parsers);

                result.Add(auto);
            }
            else
            {
                result.Add(new DefaultTitleParser());
            }

            return(result);
        }