3#include <system/exceptions.h>
5#include <system/type_info.h>
6#include <system/text/decoder_fallback_exception.h>
7#include <system/text/encoder_fallback_exception.h>
8#include <system/span.h>
9#include <system/object_ext.h>
10#include <system/default.h>
11#include <system/collections/bitarray.h>
12#include <system/array.h>
15#include "system/text/json/writer/utf8_json_writer.h"
16#include "system/text/json/document/json_value_kind.h"
17#include "system/text/json/serialization/metadata/json_type_info_kind.h"
18#include "system/text/json/json_exception.h"
19#include "system/text/json/serialization/json_converter.h"
50 class JsonPropertyInfoBase;
51 class JsonTypeInfoBase;
211 template<
typename TAttribute>
214 throw InvalidOperationException(
System::String::Format(u
"The type '{0}' cannot have more than one member that has the attribute '{1}'.", System::ExplicitCast<System::Object>(classType), System::ExplicitCast<System::Object>(System::ObjectExt::GetType<TAttribute>())));
263 static bool IsPrintable(uint8_t value);
Class that represents an array data structure. Objects of this class should only be allocated using S...
Definition: array.h:296
Class that keeps static members of System.Boolean .Net type.
Definition: boolean.h:44
Contains methods to work with the unsigned 8-bit integer.
Definition: byte.h:57
Represents a specific date and time value on the time continuum. This type should be allocated on sta...
Definition: date_time.h:50
Contains the date and time of day relative to Coordinated Universal Time. Objects of this class shoul...
Definition: date_time_offset.h:16
Represents a decimal number. This type should be allocated on stack and passed to functions by value ...
Definition: decimal.h:107
ArgumentException is thrown when an argument passed to a method being invoked is invalid....
ArgumentOutOfRangeException is thrown when a method being invoked is passed an argument that falls ou...
Template that represents wrapper of exceptions that are derived from Exception class.
Definition: exception.h:118
Represents a Globally Unique IDentifier This type should be allocated on stack and passed to function...
Definition: guid.h:34
Contains methods to work with the 16-bit integer.
Definition: int16.h:18
Contains methods to work with the 32-bit integer.
Definition: int32.h:21
Contains methods to work with the 64-bit integer.
Definition: int64.h:18
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:126
static String Format(const SharedPtr< IFormatProvider > &fp, const String &format, const Args &... args)
Formats string in C# style.
Definition: string.h:1449
Definition: read_stack.h:35
Definition: throw_helper.h:91
static void ThrowArgumentOutOfRangeException_MaxDepthMustBePositive(String parameterName)
static void ThrowJsonException_DuplicatePropertyNotAllowed()
static void ThrowJsonException_MetadataInvalidPropertyWithLeadingDollarSign(ReadOnlySpan< uint8_t > propertyName, ReadStack &state, Utf8JsonReader &reader)
static InvalidOperationException GetInvalidOperationException_ReadInvalidUTF8(DecoderFallbackException innerException=nullptr)
static void ThrowInvalidOperationException_UnsupportedEnumIdentifier(const TypeInfo &enumType, String enumName)
static void ThrowNotSupportedException_SerializationNotSupported(const TypeInfo &propertyType)
static void ThrowArgumentOutOfRangeException_IndentCharacter(String parameterName)
static InvalidOperationException GetInvalidOperationException_ExpectedArray(JsonTokenType tokenType)
static InvalidOperationException GetInvalidOperationException(String message, Exception innerException)
static void ThrowArgumentException_NodeValueNotAllowed(String paramName)
static bool AppendMissingProperty(System::SharedPtr< StringBuilder > builder, String propertyName)
static void ReThrowWithPath(WriteStack &state, Exception ex)
static void ThrowInvalidOperationException_ExpectedStringComparison(JsonTokenType tokenType)
static void ThrowArgumentException_DeserializeWrongType(const TypeInfo &type, System::SharedPtr< Object > value)
static void ThrowJsonException_DuplicatePropertyNotAllowed(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > property)
static void ThrowInvalidOperationException_DeserializeUnableToAssignNull(const TypeInfo &declaredType)
static void ThrowInvalidOperationException(String message)
static void ThrowInvalidOperationException_NodeUnableToConvertElement(JsonValueKind valueKind, const TypeInfo &destinationType)
static void ThrowFormatException(DataType dataType)
static void ThrowInvalidOperationException_CreateObjectConverterNotCompatible(const TypeInfo &type)
static void ThrowInvalidOperationException_NodeElementCannotBeObjectOrArray()
static void ThrowJsonElementWrongTypeException(JsonTokenType expectedType, JsonTokenType actualType)
static void ThrowArgumentException_CannotSerializeInvalidType(String paramName, const TypeInfo &typeToConvert, const TypeInfo &declaringType, String propertyName)
static void ThrowInvalidOperationException_NumberHandlingOnPropertyInvalid(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static void ThrowObjectDisposedException_JsonDocument()
static void ThrowPropertyNameTooLargeArgumentException(int32_t length)
static void ThrowInvalidCastException_DeserializeUnableToAssignValue(const TypeInfo &typeOfValue, const TypeInfo &declaredType)
static void ThrowJsonException_DeserializeUnableToConvertValue(const TypeInfo &propertyType)
static void ThrowInvalidOperationException_DerivedTypeIsAlreadySpecified(const TypeInfo &baseType, const TypeInfo &derivedType)
static void ThrowNotSupportedException_DeserializeNoConstructor(System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > typeInfo, Utf8JsonReader &reader, ReadStack &state)
static void ThrowInvalidOperationException_JsonPropertyRequiredAndExtensionData(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static InvalidOperationException GetJsonElementWrongTypeException(String expectedTypeName, JsonValueKind actualType)
static void ThrowInvalidOperationException_PolymorphicTypeConfigurationDoesNotSpecifyDerivedTypes(const TypeInfo &baseType)
static void ThrowInvalidOperationException_SerializerPropertyNameNull(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static Exception GetInvalidOperationException_NoMetadataForTypeProperties(System::SharedPtr< Serialization::Metadata::IJsonTypeInfoResolver > resolver, const TypeInfo &type)
static void ThrowInvalidOperationException_SerializerConverterFactoryReturnsJsonConverterFactory(const TypeInfo &converterType)
static NotSupportedException GetNotSupportedException_AmbiguousMetadataForType(const TypeInfo &type, const TypeInfo &match1, const TypeInfo &match2)
static void ThrowInvalidOperationException_ExpectedNumber(JsonTokenType tokenType)
static void ThrowInvalidOperationException_ExtensionDataCannotBindToCtorParam(String propertyName, System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static void ThrowInvalidOperationException_ExpectedComment(JsonTokenType tokenType)
static void ThrowInvalidOperationException_PropertyConflictsWithMetadataPropertyName(const TypeInfo &type, String propertyName)
static const String ExceptionSourceValueToRethrowAsJsonException
Definition: throw_helper.h:95
static void ThrowArgumentException_InvalidUTF16(int32_t charAsInt)
static void ThrowInvalidOperationException_ResolverTypeInfoOptionsNotCompatible()
static void ThrowArgumentOutOfRangeException_NeedNonNegNum(String paramName)
static String GetPrintableString(uint8_t value)
static void ThrowJsonException_MetadataValuesInvalidToken(JsonTokenType tokenType)
static void ThrowNotSupportedException(ReadStack &state, Utf8JsonReader &reader, Exception innerException)
static void ThrowNotSupportedException_RuntimeTypeNotSupported(const TypeInfo &baseType, const TypeInfo &runtimeType)
static void ThrowNotSupportedException_DerivedConverterDoesNotSupportMetadata(const TypeInfo &derivedType)
static void ThrowInvalidOperationException_NodeJsonObjectCustomConverterNotAllowedOnExtensionProperty()
static void ThrowInvalidOperationException_CannotSkipOnPartial()
static void ThrowInvalidOperationException_IgnoreConditionOnValueTypeInvalid(String clrPropertyName, const TypeInfo &propertyDeclaringType)
static JsonException GetJsonReaderException(Utf8JsonReader &json, ExceptionResource resource, uint8_t nextByte, ReadOnlySpan< uint8_t > bytes)
static void ThrowArgumentException_SerializerDoesNotSupportComments(String paramName)
static void ThrowInvalidOperationException_MultiplePropertiesBindToConstructorParameters(const TypeInfo &parentType, String parameterName, String firstMatchName, String secondMatchName)
static void ThrowInvalidOperationException(ExceptionResource resource, int32_t currentDepth, int32_t maxDepth, uint8_t token, JsonTokenType tokenType)
static void ThrowOutOfMemoryException(uint32_t capacity)
static void ThrowInvalidOperationException_ExpectedBoolean(JsonTokenType tokenType)
static InvalidOperationException GetInvalidOperationException(ExceptionResource resource, int32_t currentDepth, int32_t maxDepth, uint8_t token, JsonTokenType tokenType)
static void ThrowArgumentOutOfRangeException_CommentEnumMustBeInRange(String parameterName)
static void ThrowInvalidOperationException_JsonIncludeOnInaccessibleProperty(String memberName, const TypeInfo &declaringType)
static void ThrowInvalidOperationException_SerializerPropertyNameConflict(const TypeInfo &type, String propertyName)
static void ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType)
static void ThrowArgumentException(ReadOnlySpan< char16_t > propertyName, ReadOnlySpan< char16_t > value)
static void ThrowInvalidOperationException_NoMetadataForType(const TypeInfo &type, System::SharedPtr< Serialization::Metadata::IJsonTypeInfoResolver > resolver)
static void ThrowInvalidOperationException_NodeUnableToConvert(const TypeInfo &sourceType, const TypeInfo &destinationType)
static void ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Serialization::Metadata::JsonTypeInfoKind kind)
static void ReThrowWithPath(ReadStack &state, JsonReaderException ex)
static void ThrowNotSupportedException_RuntimeTypeDiamondAmbiguity(const TypeInfo &baseType, const TypeInfo &runtimeType, const TypeInfo &derivedType1, const TypeInfo &derivedType2)
static void ThrowArgumentOutOfRangeException_NewLine(String parameterName)
static void ThrowInvalidOperationException_NoMetadataForTypeProperties(System::SharedPtr< Serialization::Metadata::IJsonTypeInfoResolver > resolver, const TypeInfo &type)
static void ThrowJsonException_MetadataStandaloneValuesProperty(ReadStack &state, ReadOnlySpan< uint8_t > propertyName)
static void ThrowInvalidOperationException_CannotMixEncodings(Utf8JsonWriter::EnclosingContainerType previousEncoding, Utf8JsonWriter::EnclosingContainerType currentEncoding)
static void AddJsonExceptionInformation(ReadStack &state, Utf8JsonReader &reader, JsonException ex)
static InvalidOperationException GetInvalidOperationException_ExpectedObject(JsonTokenType tokenType)
static void ThrowJsonException_DuplicatePropertyNotAllowed(ReadOnlySpan< uint8_t > nameBytes)
static void ThrowFormatException()
static void ReThrowWithPath(ReadStack &state, Utf8JsonReader &reader, Exception ex)
static void ThrowInvalidOperationException_SerializationDuplicateTypeAttribute(const TypeInfo &classType)
Definition: throw_helper.h:212
static void ThrowInvalidOperationException_DerivedTypeNotSupported(const TypeInfo &baseType, const TypeInfo &derivedType)
static void ThrowInvalidOperationException_ExpectedChar(JsonTokenType tokenType)
static void ThrowInvalidOperationException_TypeClassifierNotSupported(const TypeInfo &classifierType, const TypeInfo &type)
static void ThrowJsonException_JsonRequiredPropertyMissing(const TypeInfo &type, String propertyList)
static void ThrowInvalidOperationException_ExpectedPropertyName(JsonTokenType tokenType)
static void ThrowArgumentOutOfRangeException_IndentSize(String parameterName, int32_t minimumSize, int32_t maximumSize)
static void ThrowArgumentException_JsonPolymorphismOptionsAssociatedWithDifferentJsonTypeInfo(String parameterName)
static void ThrowNotSupportedException_BaseConverterDoesNotSupportMetadata(const TypeInfo &derivedType)
static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan< uint8_t > propertyName, int32_t currentDepth, int32_t maxDepth)
static void ThrowInvalidOperationException_InvalidCustomTypeDiscriminatorPropertyName()
static void ThrowJsonException_MetadataPreservedArrayValuesNotFound(ReadStack &state, const TypeInfo &propertyType)
static void ThrowInvalidOperationException_ReadIncompleteUTF16()
static void ThrowJsonException_SerializationConverterWrite(System::SharedPtr< Serialization::JsonConverterBase > converter)
static void ThrowInvalidOperationException_JsonPropertyInfoIsBoundToDifferentJsonTypeInfo(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > propertyInfo)
static void ThrowInvalidOperationException_NodeAlreadyHasParent()
static void ThrowNotSupportedException(WriteStack &state, Exception innerException)
static void ThrowJsonException_UnrecognizedTypeDiscriminator(System::SharedPtr< Object > typeDiscriminator)
static void ThrowArgumentException_ValueNotSupported()
static void ThrowInvalidOperationException_PropertyTypeNotNullable(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static void ThrowArgumentNullException(String parameterName)
static void ThrowInvalidOperationException_ResolverTypeNotCompatible(const TypeInfo &requestedType, const TypeInfo &actualType)
static void ThrowInvalidOperationException_CannotSerializeInvalidType(const TypeInfo &typeToConvert, const TypeInfo &declaringType, System::SharedPtr< Reflection::MemberInfo > memberInfo)
static void ThrowArgumentException(String message)
static void ThrowInvalidOperationException_SerializationDataExtensionPropertyInvalid(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
static void ThrowArgumentException_InvalidUTF8(ReadOnlySpan< uint8_t > value)
static void ThrowJsonException_MetadataUnexpectedProperty(ReadOnlySpan< uint8_t > propertyName, ReadStack &state)
static void ThrowArgumentException(ReadOnlySpan< char16_t > propertyName, ReadOnlySpan< uint8_t > value)
static void ThrowNotSupportedException_DictionaryKeyTypeNotSupported(const TypeInfo &keyType, System::SharedPtr< Serialization::JsonConverterBase > converter)
static void ThrowArgumentException(ReadOnlySpan< uint8_t > propertyName, ReadOnlySpan< uint8_t > value)
static void ThrowJsonReaderException(Utf8JsonReader &json, ExceptionResource resource, uint8_t nextByte=System::Default< uint8_t >(), ReadOnlySpan< uint8_t > bytes=System::Default< System::ReadOnlySpan< uint8_t > >())
static void AddJsonExceptionInformation(WriteStack &state, JsonException ex)
static void ThrowInvalidOperationException_NodeParentWrongType(String typeName)
static void ThrowArgumentException_DestinationTooShort()
static void ThrowInvalidOperationException_SerializationDuplicateTypeAttribute(const TypeInfo &classType, const TypeInfo &attribute)
static void ThrowJsonException_MetadataValueWasNotString(JsonValueKind valueKind)
static void ThrowInvalidOperationException_TypeInfoResolverChainImmutable()
static void ThrowNotSupportedException_NoMetadataForType(const TypeInfo &type, System::SharedPtr< Serialization::Metadata::IJsonTypeInfoResolver > resolver)
static void ThrowJsonException_SerializationConverterRead(System::SharedPtr< Serialization::JsonConverterBase > converter)
static void ThrowArgumentException_ValueTooLarge(int64_t tokenLength)
static void ThrowInvalidOperationException(int32_t currentDepth, int32_t maxDepth)
static void ThrowInvalidOperationException_TypeDicriminatorIdIsAlreadySpecified(const TypeInfo &baseType, System::SharedPtr< Object > typeDiscriminator)
static void ThrowInvalidOperationException_ConstructorParameterIncompleteBinding(const TypeInfo &parentType)
static void ThrowNotSupportedException_CannotPopulateCollection(const TypeInfo &type, Utf8JsonReader &reader, ReadStack &state)
static void ThrowInvalidOperationOrArgumentException(ReadOnlySpan< char16_t > propertyName, int32_t currentDepth, int32_t maxDepth)
static void ThrowJsonException_MetadataInvalidPropertyInArrayMetadata(ReadStack &state, const TypeInfo &propertyType, Utf8JsonReader &reader)
static void ThrowArgumentException_InvalidOffLen()
static void ThrowObjectDisposedException_Utf8JsonWriter()
static void ThrowJsonException_JsonRequiredPropertyMissing(System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > parent, System::SharedPtr< Collections::BitArray > assignedOrNotRequiredPropertiesSet)
static void ThrowJsonException_DuplicateMetadataProperty(ReadOnlySpan< uint8_t > utf8PropertyName)
static void ThrowInvalidOperationException_JsonTypeInfoOnDeserializingCallbacksNotSupported(const TypeInfo &type)
static InvalidOperationException GetJsonElementWrongTypeException(JsonValueKind expectedType, JsonValueKind actualType)
static void ThrowJsonException_MetadataValueWasNotString(JsonTokenType tokenType)
static void ThrowUnexpectedMetadataException(ReadOnlySpan< uint8_t > propertyName, Utf8JsonReader &reader, ReadStack &state)
static void ThrowArgumentOutOfRangeException_JsonNumberExponentTooLarge(String parameterName)
static void ThrowInvalidOperationException_ReadInvalidUTF16(int32_t charAsInt)
static void ThrowInvalidOperationException_TypeDoesNotSupportPolymorphism(const TypeInfo &baseType)
static void ThrowFormatException(NumericType numericType)
static void ThrowArgumentException_PropertyNameTooLarge(int32_t tokenLength)
static void ThrowInvalidOperationException_JsonSerializerOptionsNoTypeInfoResolverSpecified()
static void ThrowJsonException(String message=nullptr)
static void ThrowJsonException_SerializerCycleDetected(int32_t maxDepth)
static void ThrowArgumentNullException(ExceptionArgument argument)
static void ThrowInvalidOperationException_NodeWrongType(const System::SharedPtr< Array< String > > &supportedTypeNames)
static ArgumentException GetArgumentException_ReadInvalidUTF16(EncoderFallbackException innerException)
static void ThrowInvalidOperationException_InvalidChainedResolver()
static void ThrowInvalidOperationException_TypeInfoImmutable()
static void ThrowInvalidOperationException_SerializerCycleDetected(int32_t maxDepth)
static void ThrowInvalidOperationException_NodeCycleDetected()
static void ThrowInvalidOperationException_SerializerOptionsReadOnly(System::SharedPtr< Serialization::JsonSerializerContext > context)
static void ThrowInvalidOperationException_SerializerConverterFactoryReturnsNull(const TypeInfo &converterType)
static void ThrowArgumentException(ReadOnlySpan< uint8_t > propertyName, ReadOnlySpan< char16_t > value)
static void ThrowInvalidOperationException_NamingPolicyReturnNull(System::SharedPtr< JsonNamingPolicy > namingPolicy)
static void ThrowInvalidOperationException_NeedLargerSpan()
static void ThrowJsonException_DuplicatePropertyNotAllowed(String name)
static void ThrowInvalidOperationException_JsonPropertyRequiredAndNotDeserializable(System::SharedPtr< Serialization::Metadata::JsonPropertyInfoBase > jsonPropertyInfo)
Definition: utf8_json_reader.h:78
EnclosingContainerType
Definition: utf8_json_writer.h:114
Definition: write_stack.h:34
Represents a time interval. This type should be allocated on stack and passed to functions by value o...
Definition: timespan.h:59
Represents a particular type and provides information about it.
Definition: type_info.h:109
Represents a version number. This type should be allocated on stack and passed to functions by value ...
Definition: version.h:16
@ Text
Defines color adjustment information for text.
JsonTypeInfoKind
Definition: json_type_info_kind.h:14
JsonTokenType
Definition: json_token_type.h:12
ExceptionResource
Definition: throw_helper.h:273
@ ExpectedOneCompleteToken
@ ArgumentOutOfRange_IndexMustBeLess
@ InvalidCharacterAfterEscapeWithinString
@ InvalidEndOfJsonNonPrimitive
@ CannotWriteWithinString
@ CannotWritePropertyWithinArray
@ TrailingCommaNotAllowedBeforeObjectEnd
@ ExpectedStartOfPropertyNotFound
@ ExpectedEndOfDigitNotFound
@ ExpectedStartOfPropertyOrValueNotFound
@ InvalidHexCharacterWithinString
@ ExpectedNextDigitEValueNotFound
@ InvalidLeadingZeroInNumber
@ RequiredDigitNotFoundAfterSign
@ UnexpectedEndOfDataWhileReadingComment
@ RequiredDigitNotFoundAfterDecimal
@ CannotWriteValueWithinObject
@ CannotStartObjectArrayWithoutProperty
@ TrailingCommaNotAllowedBeforeArrayEnd
@ InvalidCharacterAtStartOfComment
@ ExpectedEndAfterSingleJson
@ ExpectedValueAfterPropertyNameNotFound
@ Argument_CannotExtractScalar
@ CannotWriteValueAfterPrimitiveOrClose
@ UnexpectedEndOfLineSeparator
@ ExpectedStartOfValueNotFound
@ ExpectedStartOfPropertyOrValueAfterComment
@ CannotStartObjectArrayAfterPrimitiveOrClose
@ RequiredDigitNotFoundEndOfData
@ ExpectedSeparatorAfterPropertyNameNotFound
@ InvalidCharacterWithinString
DataType
Definition: throw_helper.h:78
JsonValueKind
Definition: json_value_kind.h:12
NumericType
Definition: throw_helper.h:56
Definition: db_command.h:9
ExceptionArgument
Definition: throw_helper.h:32
std::enable_if< IsExceptionWrapper< T >::value, constT & >::type Default()
Returns the reference to the single default-constructed instance of the exception type.
Definition: default.h:16
Contains methods to work with the double-precision floating-point number.
Definition: double.h:18
Contains methods to work with the 8-bit integer.
Definition: sbyte.h:18
Contains methods to work with the single-precision floating-point number.
Definition: single.h:18
Contains methods to work with the unsigned 16-bit integer.
Definition: uint16.h:18
Contains methods to work with the unsigned 32-bit integer.
Definition: uint32.h:18
Contains methods to work with the unsigned 64-bit integer.
Definition: uint64.h:18