| | 1 | | using Newtonsoft.Json.Linq; |
| | 2 | | using ValidateLib.ErrorsAndWarnings.Warnings; |
| | 3 | | using ValidateLib.Metadata.Descriptors; |
| | 4 | | using ValidateLib.Metadata.Parsers; |
| | 5 | | using ValidateLib.Metadata.Properties.AtomicProperties; |
| | 6 | | using ValidateLib.Metadata.Validators; |
| | 7 | |
|
| | 8 | | namespace ValidateLib.Metadata.PropertyParsers.InheritedProperties |
| | 9 | | { |
| | 10 | | internal class DatatypePropertyParser : PropertyParserBase<InheritedPropertiesDescriptor>, IPropertyParser<Inherited |
| | 11 | | { |
| 1 | 12 | | public DatatypePropertyParser(List<Warning> warnings, InheritedPropertiesDescriptor? descriptor = null) : base(w |
| | 13 | | { |
| 1 | 14 | | } |
| | 15 | |
|
| | 16 | | public void ParseProperty(JProperty property) |
| | 17 | | { |
| 1 | 18 | | var datatypeParser = new DatatypeParser(Warnings); |
| 1 | 19 | | var datatypePropertyValue = datatypeParser.ParseJToken(property.Value, property.Name); |
| 1 | 20 | | if (!datatypePropertyValue.IsInvalid) |
| | 21 | | { |
| 1 | 22 | | DatatypeValidator datatypeValidator = new DatatypeValidator(); |
| 1 | 23 | | Descriptor.datatype = new AtomicProperty<DatatypeDescriptor>(datatypePropertyValue); |
| 1 | 24 | | Warnings.AddRange(datatypeValidator.Validate(Descriptor)); |
| | 25 | | } |
| | 26 | |
|
| | 27 | |
|
| 1 | 28 | | } |
| | 29 | | } |
| | 30 | | } |