| | 1 | | using Newtonsoft.Json.Linq; |
| | 2 | | using System.Resources; |
| | 3 | | using ValidateLib.ErrorsAndWarnings.Warnings.SpecificWarnings; |
| | 4 | |
|
| | 5 | | namespace ValidateLib.ErrorsAndWarnings.Warnings |
| | 6 | | { |
| | 7 | | public class WarningFactory |
| | 8 | | { |
| 0 | 9 | | static ResourceManager _ResourceManager { get; set; } = |
| 0 | 10 | | new ResourceManager(EWConstants.GeneralResources, typeof(ErrorOrWarning).Assembly); |
| | 11 | | public static WrongTypeOfPropertyValueWarning GetWrongTypeOfPropertyValueWarning(string invalidProperty, string? |
| | 12 | | { |
| 0 | 13 | | var wm = _ResourceManager.GetString("WrongTypeOfPropertyValue"); |
| 0 | 14 | | return new WrongTypeOfPropertyValueWarning(invalidProperty) |
| 0 | 15 | | { |
| 0 | 16 | | AdditionalInfo = additionalInfo |
| 0 | 17 | | }; |
| | 18 | | } |
| | 19 | |
|
| | 20 | | public static UnknownPropertyWarning GetUnknownPropertyWarning(JProperty unknownProperty, string? additionalInfo |
| | 21 | | { |
| 1 | 22 | | return new UnknownPropertyWarning(unknownProperty) |
| 1 | 23 | | { |
| 1 | 24 | | AdditionalInfo = additionalInfo |
| 1 | 25 | | }; |
| | 26 | | } |
| | 27 | |
|
| | 28 | | public static UnkownPrefixWarning GetUnknownPrefixWarning(string unknownPrefix, string? additionalInfo = null) |
| | 29 | | { |
| 1 | 30 | | return new UnkownPrefixWarning(unknownPrefix) |
| 1 | 31 | | { |
| 1 | 32 | | AdditionalInfo = additionalInfo |
| 1 | 33 | | }; |
| | 34 | | } |
| | 35 | |
|
| | 36 | | public static DoubleDotOrUknownPropertyWarning GetDoubleDotOrUknownPropertyWarning(string IRI, string value, str |
| | 37 | | { |
| 1 | 38 | | return new DoubleDotOrUknownPropertyWarning(IRI, value) |
| 1 | 39 | | { |
| 1 | 40 | | AdditionalInfo = additionalInfo |
| 1 | 41 | | }; |
| | 42 | | } |
| | 43 | |
|
| | 44 | | public static ObjectStringNormalizationProblemWarning GetObjectStringNormalizationProblemWarning(string notNorma |
| | 45 | | { |
| 0 | 46 | | return new ObjectStringNormalizationProblemWarning(notNormalizedProperty, propertyName) |
| 0 | 47 | | { |
| 0 | 48 | | AdditionalInfo = additionalInfo |
| 0 | 49 | | }; |
| | 50 | | } |
| | 51 | |
|
| | 52 | | public static InvalidFormatPatternWarning GetInvalidFormatPatternWarning(string invalidPattern, string? addition |
| | 53 | | { |
| 1 | 54 | | return new InvalidFormatPatternWarning(invalidPattern) |
| 1 | 55 | | { |
| 1 | 56 | | AdditionalInfo = additionalInfo |
| 1 | 57 | | }; |
| | 58 | | } |
| | 59 | |
|
| | 60 | | public static FoundMetadataFileNotDescribingTabularFileWarning GetFoundMetadataFileNotDescribingTabularFileWarni |
| | 61 | | { |
| 1 | 62 | | return new FoundMetadataFileNotDescribingTabularFileWarning(metadataIRI) |
| 1 | 63 | | { |
| 1 | 64 | | AdditionalInfo = additionalInfo |
| 1 | 65 | | }; |
| | 66 | | } |
| | 67 | |
|
| | 68 | | public static DecimalCharOrGroupCharNotOnNumericWarning GetDecimalCharOrGroupCharNotOnNumericWarning(string base |
| | 69 | | { |
| 0 | 70 | | return new DecimalCharOrGroupCharNotOnNumericWarning(baseDTName); |
| | 71 | | } |
| | 72 | |
|
| | 73 | | public static InvalidContextLanuageWarning GetInvalidContextLanuageWarning(string invalidValue) |
| | 74 | | { |
| 1 | 75 | | return new InvalidContextLanuageWarning(invalidValue); |
| | 76 | | } |
| | 77 | |
|
| | 78 | | public static ObjectPropertyWrongValueWarning GetObjectPropertyWrongValueWarning(JToken token, string invalidVal |
| | 79 | | { |
| 1 | 80 | | return new ObjectPropertyWrongValueWarning(token, invalidValue); |
| | 81 | | } |
| | 82 | |
|
| | 83 | | public static ArrayPropertyWrongValueWarning GetArrayPropertyWrongValueWarning(JProperty invalidValue, string de |
| | 84 | | { |
| 1 | 85 | | return new ArrayPropertyWrongValueWarning(invalidValue.Value, invalidValue.Name, detectedDatatype); |
| | 86 | | } |
| | 87 | |
|
| | 88 | | public static AtomicPropertyBoolWrongValueWarning GetAtomicPropertyBoolWrongValueWarning(JToken value, string na |
| | 89 | | { |
| 1 | 90 | | return new AtomicPropertyBoolWrongValueWarning(value, name, detectedDatatype); |
| | 91 | | } |
| | 92 | |
|
| | 93 | | public static LinkPropertyWrongValueWarning GetLinkPropertyWrongValueWarning(JToken value, string name, string d |
| | 94 | | { |
| 1 | 95 | | return new LinkPropertyWrongValueWarning(value, name, detectedDatatype); |
| | 96 | | } |
| | 97 | |
|
| | 98 | | public static LinkPropertyNotAbsoluteWarning GetLinkPropertyNotAbsoluteWarning(JToken value, string name) |
| | 99 | | { |
| 1 | 100 | | return new LinkPropertyNotAbsoluteWarning(value, name); |
| | 101 | | } |
| | 102 | |
|
| | 103 | | public static NaturalLanguageWrongValue GetNaturalLanguageWrongValue(JToken value, string name) |
| | 104 | | { |
| 1 | 105 | | return new NaturalLanguageWrongValue(value, name); |
| | 106 | | } |
| | 107 | |
|
| | 108 | | public static URITemplateWrongValueWarning GetURITemplateWrongValueWarning(JToken value, string name) |
| | 109 | | { |
| 1 | 110 | | return new URITemplateWrongValueWarning(value, name); |
| | 111 | | } |
| | 112 | |
|
| | 113 | | public static StringPropertyWrongValueWarning GetStringPropertyWrongValueWarning(JToken value, string name, stri |
| | 114 | | { |
| 1 | 115 | | return new StringPropertyWrongValueWarning(value, name, detectedDatatype); |
| | 116 | | } |
| | 117 | | public static WrongColumnNameWarning GetWrongColumnNameWarning(string wrongName) |
| | 118 | | { |
| 1 | 119 | | return new WrongColumnNameWarning(wrongName); |
| | 120 | | } |
| | 121 | |
|
| | 122 | | public static CommonPropertyWrongValueWarning GetCommonPropertyWrongValueWarning(JToken value, string name) |
| | 123 | | { |
| 0 | 124 | | return new CommonPropertyWrongValueWarning(value, name); |
| | 125 | | } |
| | 126 | |
|
| | 127 | | public static DatatypeBaseWrongValueWarning GetDatatypeBaseWrongValueWarning(string wrongName) |
| | 128 | | { |
| 1 | 129 | | return new DatatypeBaseWrongValueWarning(wrongName); |
| | 130 | | } |
| | 131 | |
|
| | 132 | | public static FormatPropertyWrongValueWarning GetFormatPropertyWrongValueWarning(string wrongName, string detect |
| | 133 | | { |
| 0 | 134 | | return new FormatPropertyWrongValueWarning(wrongName, detectedDatatype); |
| | 135 | | } |
| | 136 | |
|
| | 137 | | public static AtomicIntegerWrongValueWarning GetAtomicIntegerWrongValueWarning(JToken value, string name, string |
| | 138 | | { |
| 1 | 139 | | return new AtomicIntegerWrongValueWarning(value, name, detectedDatatype); |
| | 140 | | } |
| | 141 | |
|
| | 142 | | public static ValueConstraintWrongValueWarning GetValueConstraintWrongValueWarning(JToken value, string name) |
| | 143 | | { |
| 0 | 144 | | return new ValueConstraintWrongValueWarning(value, name); |
| | 145 | | } |
| | 146 | |
|
| | 147 | | public static LengthConstraintWrongValueWarning GetLengthConstraintWrongValueWarning(JToken value, string name) |
| | 148 | | { |
| 0 | 149 | | return new LengthConstraintWrongValueWarning(value, name); |
| | 150 | | } |
| | 151 | | public static LineTerminatorsWrongValueWarning GetLineTerminatorsWrongValueWarning(string value, string detected |
| | 152 | | { |
| 1 | 153 | | return new LineTerminatorsWrongValueWarning(value, detectedDatatype); |
| | 154 | | } |
| | 155 | |
|
| | 156 | | public static QuoteCharWrongValueWarning GetQuoteCharWrongValueWarning(string value, string detectedDatatype) |
| | 157 | | { |
| 1 | 158 | | return new QuoteCharWrongValueWarning(value, detectedDatatype); |
| | 159 | | } |
| | 160 | |
|
| | 161 | | public static NegativeSkipRowsWarning GetNegativeSkipRowsWarning(string value) |
| | 162 | | { |
| 1 | 163 | | return new NegativeSkipRowsWarning(value); |
| | 164 | | } |
| | 165 | |
|
| | 166 | | public static InvalidTrimValueWarning GetInvalidTrimValueWarning(string value) |
| | 167 | | { |
| 0 | 168 | | return new InvalidTrimValueWarning(value); |
| | 169 | | } |
| | 170 | |
|
| | 171 | | public static InvalidColumnReferenceValue GetInvalidColumnReferenceValue(string value, string detectedDatatype) |
| | 172 | | { |
| 0 | 173 | | return new InvalidColumnReferenceValue(value, detectedDatatype); |
| | 174 | | } |
| | 175 | |
|
| | 176 | | public static LangWrongValueWarning GetLangWrongValueWarning(string value) |
| | 177 | | { |
| 1 | 178 | | return new LangWrongValueWarning(value); |
| | 179 | | } |
| | 180 | |
|
| | 181 | | public static NullInvalidValueWarning GetNullInvalidValueWarning(string value) |
| | 182 | | { |
| 1 | 183 | | return new NullInvalidValueWarning(value); |
| | 184 | | } |
| | 185 | |
|
| | 186 | | public static SeparatorInvalidValueWarning GetSeparatorInvalidValueWarning(string value) |
| | 187 | | { |
| 1 | 188 | | return new SeparatorInvalidValueWarning(value); |
| | 189 | | } |
| | 190 | |
|
| | 191 | | public static TextDirectionWrongValueWarning GetTextDirectionWrongValueWarning(string value) |
| | 192 | | { |
| 1 | 193 | | return new TextDirectionWrongValueWarning(value); |
| | 194 | | } |
| | 195 | |
|
| | 196 | | public static ColumnReferencePropertyWrongValueWarning GetColumnReferencePropertyWrongValueWarning(JToken value, |
| | 197 | | { |
| 0 | 198 | | return new ColumnReferencePropertyWrongValueWarning(value, name, detectedDatatype); |
| | 199 | | } |
| | 200 | |
|
| | 201 | | public static TableDirectionWrongValueWarning GetTableDirectionWrongValueWarning(string value) |
| | 202 | | { |
| 1 | 203 | | return new TableDirectionWrongValueWarning(value); |
| | 204 | | } |
| | 205 | |
|
| | 206 | | public static SourceWrongValueWarning GetSourceWrongValueWarning(string value) |
| | 207 | | { |
| 0 | 208 | | return new SourceWrongValueWarning(value); |
| | 209 | | } |
| | 210 | |
|
| | 211 | | public static FormatOnInvalidDTWarning GetFormatOnInvalidDTWarning(string value) |
| | 212 | | { |
| 1 | 213 | | return new FormatOnInvalidDTWarning(value); |
| | 214 | | } |
| | 215 | |
|
| | 216 | | public static ReferencedCOlumnDoesNotExistWarning GetReferencedCOlumnDoesNotExistWarning(string value, string na |
| | 217 | | { |
| 1 | 218 | | return new ReferencedCOlumnDoesNotExistWarning(value, name); |
| | 219 | | } |
| | 220 | |
|
| | 221 | | public static InvalidEncodingValueWarning GetInvalidEncodingValueWarning(string value) |
| | 222 | | { |
| 1 | 223 | | return new InvalidEncodingValueWarning(value); |
| | 224 | | } |
| | 225 | |
|
| | 226 | | public static BomPresentWarning GetBomPresentWarning(string value) |
| | 227 | | { |
| 1 | 228 | | return new BomPresentWarning(value); |
| | 229 | | } |
| | 230 | | } |
| | 231 | | } |