/// <summary> /// Initializes a new instance of <see cref="ValueTypeErrorAtPropertyKey"/>. /// </summary> /// <param name="typeErrorBuilder"> /// The context insensitive information for this error message. /// </param> /// <param name="keyNode"> /// The property key for which the error is generated. /// </param> /// <param name="valueNode"> /// The value node corresponding to the value that was typechecked. /// </param> /// <param name="json"> /// The source json which contains the type error. /// </param> /// <param name="keyNodeStart"> /// The start position of the key node in the source json. /// </param> /// <param name="valueNodeStart"> /// The start position of the value node in the source json. /// </param> /// <returns> /// A <see cref="ValueTypeErrorAtPropertyKey"/> instance which generates a localized error message. /// </returns> /// <exception cref="ArgumentNullException"> /// <paramref name="typeErrorBuilder"/> and/or <paramref name="keyNode"/> and/or <paramref name="valueNode"/> and/or <paramref name="json"/> are null. /// </exception> public static ValueTypeErrorAtPropertyKey Create( ITypeErrorBuilder typeErrorBuilder, GreenJsonStringLiteralSyntax keyNode, GreenJsonValueSyntax valueNode, string json, int keyNodeStart, int valueNodeStart) { if (typeErrorBuilder == null) { throw new ArgumentNullException(nameof(typeErrorBuilder)); } return(new ValueTypeErrorAtPropertyKey( typeErrorBuilder, PTypeErrorBuilder.GetPropertyKeyDisplayString(keyNode, json, keyNodeStart), PTypeErrorBuilder.GetValueDisplayString(valueNode, json, valueNodeStart), valueNodeStart, valueNode.Length)); }
/// <summary> /// Initializes a new instance of <see cref="UnrecognizedPropertyKeyTypeError"/>. /// </summary> /// <param name="keyNode"> /// The property key for which the error is generated. /// </param> /// <param name="json"> /// The source json which contains the type error. /// </param> /// <param name="keyNodeStart"> /// The start position of the key node in the source json. /// </param> /// <returns> /// A <see cref="UnrecognizedPropertyKeyTypeError"/> instance which generates a localized error message. /// </returns> /// <exception cref="ArgumentNullException"> /// <paramref name="keyNode"/> and/or <paramref name="json"/> are null. /// </exception> public static UnrecognizedPropertyKeyTypeError Create(GreenJsonStringLiteralSyntax keyNode, string json, int keyNodeStart) => new UnrecognizedPropertyKeyTypeError( PTypeErrorBuilder.GetPropertyKeyDisplayString(keyNode, json, keyNodeStart), keyNodeStart, keyNode.Length);