| | 1 | | using Newtonsoft.Json.Linq; |
| | 2 | | using ValidateLib.ErrorsAndWarnings.Warnings; |
| | 3 | | using ValidateLib.Metadata.Descriptors; |
| | 4 | | using ValidateLib.UtilityClasses; |
| | 5 | |
|
| | 6 | | namespace ValidateLib.Metadata.PropertyParsers.Column |
| | 7 | | { |
| | 8 | | internal class NamePropertyParser : PropertyParserBase<ColumnDescriptor>, IPropertyParser<ColumnDescriptor> |
| | 9 | | { |
| 1 | 10 | | public NamePropertyParser(List<Warning> warnings, ColumnDescriptor? descriptor = null) : base(warnings, descript |
| | 11 | | { |
| 1 | 12 | | } |
| | 13 | |
|
| | 14 | | public void ParseProperty(JProperty property) |
| | 15 | | { |
| 1 | 16 | | if (property.Value.Type != JTokenType.String) |
| | 17 | | { |
| 1 | 18 | | Warnings.Add(WarningFactory.GetStringPropertyWrongValueWarning(property.Value, property.Name, property.V |
| 1 | 19 | | return; |
| | 20 | | } |
| | 21 | | else |
| | 22 | | { |
| 1 | 23 | | if (!ColumnUtilityClass.IsValidColumnName(property.Value.ToString()) || property.Value.ToString().Starts |
| 1 | 24 | | Warnings.Add(WarningFactory.GetWrongColumnNameWarning(property.Value.ToString())); |
| | 25 | | else |
| 1 | 26 | | Descriptor.name = new Properties.AtomicProperties.AtomicPropertyString(property.Value.ToString()); |
| | 27 | | } |
| 1 | 28 | | } |
| | 29 | | } |
| | 30 | | } |