| | 1 | | using Newtonsoft.Json.Linq; |
| | 2 | | using ValidateLib.ErrorsAndWarnings.Warnings; |
| | 3 | | using ValidateLib.Metadata.Descriptors; |
| | 4 | | using ValidateLib.Metadata.Properties.AtomicProperties; |
| | 5 | |
|
| | 6 | | namespace ValidateLib.Metadata.PropertyParsers.DIalect |
| | 7 | | { |
| | 8 | | internal class SkipColumnsPropertyParser : PropertyParserBase<DialectDescriptor>, IPropertyParser<DialectDescriptor> |
| | 9 | | { |
| 1 | 10 | | public SkipColumnsPropertyParser(List<Warning> warnings, DialectDescriptor descriptor) : base(warnings, descript |
| | 11 | | { |
| 1 | 12 | | } |
| | 13 | |
|
| | 14 | | public void ParseProperty(JProperty property) |
| | 15 | | { |
| 1 | 16 | | if (property.Value.Type != JTokenType.Integer) |
| | 17 | | { |
| 1 | 18 | | Warnings.Add(WarningFactory.GetAtomicIntegerWrongValueWarning(property.Value, property.Name, property.Va |
| 1 | 19 | | Descriptor.skipColumns = new AtomicPropertyInteger(0); |
| | 20 | | } |
| | 21 | | else |
| | 22 | | { |
| 1 | 23 | | if ((int)property.Value >= 0) |
| 1 | 24 | | Descriptor.skipColumns = new AtomicPropertyInteger((int)property.Value); |
| | 25 | | else |
| 0 | 26 | | Descriptor.skipColumns = new AtomicPropertyInteger(0); |
| | 27 | | } |
| 0 | 28 | | } |
| | 29 | | } |
| | 30 | | } |