Пример #1
0
 public ParserBuilder()
 {
     RegisterTokenization <POSIXTokenizerBuilder>(x => x.AllowShortOptionGroups = true);
     types          = new List <ParsingTypeInfo>();
     typeValidator  = new TypeValidator(types);
     typeRegisterer = new TypeRegisterer(typeValidator, argumentValidator);
     LoadDefaultConverters();
 }
Пример #2
0
 public static ITypeValidator Init(this ITypeValidator validator, IValidateRule rule)
 {
     if (rule.ErrorCode != null)
     {
         validator.ErrorCode = rule.ErrorCode;
     }
     if (rule.Message != null)
     {
         validator.Message = rule.Message;
     }
     if (rule is ValidateRequestAttribute attr)
     {
         if (attr.StatusCode != default)
         {
             validator.StatusCode = attr.StatusCode;
         }
     }
     return(validator);
 }
Пример #3
0
        public ITypeValidator GetCardsType(IList <ITypeValidator> validators)
        {
            CardsType = validators.First(x => x.IsSatisfied(this));

            return(CardsType);
        }
Пример #4
0
 public TypeRegisterer(ITypeValidator typeValidator, IPropertyValidator propertyValidator)
 {
     this.typeValidator     = typeValidator ?? throw new ArgumentNullException(nameof(typeValidator));
     this.propertyValidator = propertyValidator ?? throw new ArgumentNullException(nameof(propertyValidator));
 }
 public FieldValidator(ITypeValidator typeValidator)
 {
     TypeValidator = typeValidator;
 }
Пример #6
0
 public TypeDictionaryPopulator(NamedTypeDictionary dictionary, ITypeValidator validator)
 {
     _dictionary = dictionary;
     _validator  = validator;
 }
Пример #7
0
 public Validator <T> SetUp(ITypeValidator <T> typeValidator)
 {
     TypeValidator = typeValidator;
     return(this);
 }