3#include <system/type_info.h>
4#include <system/exception.h>
5#include <system/object_ext.h>
6#include <system/nullable.h>
7#include <system/details/pointer_collection_helpers.h>
8#include <system/details/patterns.h>
9#include <system/constraints.h>
10#include <system/collections/iequality_comparer.h>
11#include <system/array.h>
14#include "system/text/json/serialization/configuration_list.h"
15#include "system/text/json/serialization/json_converter.h"
16#include "system/text/json/serialization/json_serializer_context.h"
17#include "system/text/json/serialization/json_type_classifier_factory.h"
18#include "system/text/json/serialization/metadata/json_type_info_resolver_chain.h"
26template <
typename,
typename>
class ConcurrentDictionary;
30template <
typename>
class IList;
35namespace CompilerServices
46class JavaScriptEncoder;
52class JsonDocumentOptions;
53class JsonNamingPolicy;
54class JsonReaderOptions;
57class JsonWriterOptions;
63template <
typename>
class JsonValueCustomized;
68class JsonConverterBase;
71class DefaultObjectConverter;
72class JsonArrayConverter;
73class JsonNodeConverter;
74class JsonObjectConverter;
75class JsonValueConverter;
77template <
typename>
class ObjectDefaultConverter;
78template <
typename>
class ObjectWithParameterizedConstructorConverter;
80template <
typename>
class JsonConverter;
83template <
typename>
class JsonResumableConverter;
84class JsonTypeClassifierContext;
87class IJsonTypeInfoResolver;
88class JsonMetadataServices;
89class JsonPropertyInfoBase;
90class JsonTypeInfoBase;
91class PolymorphicTypeResolver;
92template <
typename>
class JsonPropertyInfo;
93template <
typename>
class JsonTypeInfo;
96class Utf8JsonWriterCache;
115 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
116 ASPOSECPP_SHARED_RTTI_INFO_DECL();
147 class EqualityComparer;
156 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
166 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
174 bool IsNearestAncestorResolved;
184 #ifdef ASPOSE_GET_SHARED_MEMBERS
185 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
206 #ifdef ASPOSE_GET_SHARED_MEMBERS
207 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
233 static const int32_t MaxTrackedContexts = 64;
239 static struct __StaticConstructor__ { __StaticConstructor__(); } s_constructor__;
252 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
264 typedef ConverterList ThisType;
267 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
282 virtual ~ConverterList();
284 #ifdef ASPOSE_GET_SHARED_MEMBERS
285 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
294 class TypeClassifierList final :
public Serialization::ConfigurationList<System::SharedPtr<Serialization::JsonTypeClassifierFactoryBase>>
296 typedef TypeClassifierList ThisType;
297 typedef Serialization::ConfigurationList<System::SharedPtr<Serialization::JsonTypeClassifierFactoryBase>> BaseType;
299 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
304 bool get_IsReadOnly()
const override;
308 void SetTemplateWeakPtr(uint32_t argument)
override;
312 void OnCollectionModifying()
override;
314 virtual ~TypeClassifierList();
316 #ifdef ASPOSE_GET_SHARED_MEMBERS
317 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
326 class OptionsBoundJsonTypeInfoResolverChain final :
public Serialization::Metadata::JsonTypeInfoResolverChain
328 typedef OptionsBoundJsonTypeInfoResolverChain ThisType;
329 typedef Serialization::Metadata::JsonTypeInfoResolverChain BaseType;
331 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
336 bool get_IsReadOnly()
const override;
340 void DetachFromOptions();
345 void OnCollectionModifying()
override;
346 void OnCollectionModified()
override;
348 virtual ~OptionsBoundJsonTypeInfoResolverChain();
350 #ifdef ASPOSE_GET_SHARED_MEMBERS
351 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
404 return System::ExplicitCast<System::Text::Json::Serialization::Metadata::JsonTypeInfo<T>>(GetTypeInfoInternal(System::ObjectExt::GetType<T>(),
true,
true,
true));
410 typeInfo = System::ExplicitCast<System::Text::Json::Serialization::Metadata::JsonTypeInfo<T>>(GetTypeInfoInternal(System::ObjectExt::GetType<T>(),
true,
nullptr,
true));
411 return !System::IsNull(typeInfo);
418 template<
typename TContext>
422 assert_is_base_of(BaseT_JsonSerializerContext, TContext);
423 assert_is_constructable(TContext);
426 TContext context = System::MakeObject<TContext>();
462 #ifdef ASPOSE_GET_SHARED_MEMBERS
463 void GetSharedMembers(System::Object::shared_members_type& result)
const override;
480 int32_t _defaultBufferSize;
482 bool _ignoreNullValues;
485 bool _propertyNameCaseInsensitive;
487 char16_t _indentCharacter;
490 int32_t pr_EffectiveMaxDepth;
492 void set_EffectiveMaxDepth(int32_t value);
496 bool _isConfiguredForJsonSerializer;
499 String get_DebuggerDisplay();
Interface providing means to compare two objects for equality. Objects of this class should only be a...
Definition: iequality_comparer.h:18
virtual bool Equals(T x, T y) const =0
Checks if two objects are equal.
Interface of indexed container of elements. Objects of this class should only be allocated using Syst...
Definition: ilist.h:20
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:51
virtual int32_t GetHashCode() const
Analog of C# Object.GetHashCode() method. Enables hashing of custom objects.
Definition: json_serializer_options.h:37
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
Definition: json_document_options.h:26
Definition: json_reader_options.h:26
Definition: json_serializer_options.h:152
System::SharedPtr< JsonSerializerOptions > get_Options()
System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > GetOrAddTypeInfo(const TypeInfo &type, bool fallBackToNearestAncestorType=false)
virtual ~CachingContext()
bool TryGetTypeInfo(const TypeInfo &type, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > &typeInfo)
CachingContext(System::SharedPtr< JsonSerializerOptions > options, int32_t hashCode)
Definition: json_serializer_options.h:224
TrackedCachingContexts()=delete
static System::SharedPtr< JsonSerializerOptions::CachingContext > GetOrCreate(System::SharedPtr< JsonSerializerOptions > options)
Definition: json_serializer_options.h:111
Nodes::JsonNodeOptions GetNodeOptions()
friend class Utf8JsonWriterCache
Definition: json_serializer_options.h:134
System::SharedPtr< Serialization::Metadata::JsonTypeInfo< T > > GetTypeInfo()
Definition: json_serializer_options.h:402
System::SharedPtr< Serialization::JsonConverterBase > GetConverterFromList(const TypeInfo &typeToConvert)
Serialization::JsonNumberHandling get_NumberHandling()
void set_PropertyNameCaseInsensitive(bool value)
void set_MaxDepth(int32_t value)
JsonSerializerOptions(JsonSerializerDefaults defaults)
JsonCommentHandling get_ReadCommentHandling()
System::SharedPtr< JsonNamingPolicy > get_DictionaryKeyPolicy()
System::SharedPtr< JsonSerializerOptions::CachingContext > get_CacheContext()
void set_NumberHandling(Serialization::JsonNumberHandling value)
void set_IncludeFields(bool value)
int32_t get_DefaultBufferSize()
JsonReaderOptions GetReaderOptions()
void set_IndentSize(int32_t value)
System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > get_ObjectTypeInfo()
System::SharedPtr< Collections::Generic::IList< System::SharedPtr< Serialization::Metadata::IJsonTypeInfoResolver > > > get_TypeInfoResolverChain()
System::SharedPtr< Serialization::JsonTypeClassifierFactoryBase > GetTypeClassifierFromList(System::SharedPtr< Serialization::JsonTypeClassifierContext > context)
void set_IndentCharacter(char16_t value)
bool get_PropertyNameCaseInsensitive()
static const int32_t BufferSizeDefault
Definition: json_serializer_options.h:437
virtual ~JsonSerializerOptions()
JsonSerializerOptions(System::SharedPtr< JsonSerializerOptions > options)
JsonWriterOptions GetWriterOptions()
int32_t get_EffectiveMaxDepth()
System::SharedPtr< Encodings::Web::JavaScriptEncoder > get_Encoder()
void AddContext()
Definition: json_serializer_options.h:419
bool get_IgnoreNullValues()
Serialization::JsonIgnoreCondition get_DefaultIgnoreCondition()
void set_DefaultIgnoreCondition(Serialization::JsonIgnoreCondition value)
System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > GetTypeInfoForRootType(const TypeInfo &type, bool fallBackToNearestAncestorType=false)
void set_WriteIndented(bool value)
friend class JsonSerializer
Definition: json_serializer_options.h:118
bool TryGetTypeInfo(const TypeInfo &type, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > &typeInfo)
void set_IgnoreNullValues(bool value)
System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > GetTypeInfoInternal(const TypeInfo &type, bool ensureConfigured=true, Nullable< bool > ensureNotNull=true, bool resolveIfMutable=false, bool fallBackToNearestAncestorType=false)
System::SharedPtr< Serialization::JsonConverterBase > GetConverterInternal(const TypeInfo &typeToConvert)
JsonWriterOptions GetWriterOptionsForJsonLines()
void set_DictionaryKeyPolicy(System::SharedPtr< JsonNamingPolicy > value)
void set_PropertyNamingPolicy(System::SharedPtr< JsonNamingPolicy > value)
void set_ReadCommentHandling(JsonCommentHandling value)
static const int32_t DefaultMaxDepth
Definition: json_serializer_options.h:438
bool TryGetPolymorphicTypeInfoForRootType(System::SharedPtr< Object > rootValue, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > &polymorphicTypeInfo)
System::SharedPtr< Serialization::Metadata::IJsonTypeInfoResolver > get_TypeInfoResolver()
friend class WriteStack
Definition: json_serializer_options.h:135
bool TryGetTypeInfoCached(const TypeInfo &type, System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > &typeInfo)
friend class ReadStack
Definition: json_serializer_options.h:119
void set_Encoder(System::SharedPtr< Encodings::Web::JavaScriptEncoder > value)
bool TryGetTypeInfo(System::SharedPtr< Serialization::Metadata::JsonTypeInfo< T > > &typeInfo)
Definition: json_serializer_options.h:408
System::SharedPtr< Collections::Generic::IList< System::SharedPtr< Serialization::JsonTypeClassifierFactoryBase > > > get_TypeClassifiers()
bool get_CanUseFastPathSerializationLogic()
friend class WriteStackFrame
Definition: json_serializer_options.h:136
JsonDocumentOptions GetDocumentOptions()
System::SharedPtr< Serialization::Metadata::JsonTypeInfoBase > GetTypeInfo(const TypeInfo &type)
static void CheckConverterNullabilityIsSameAsPropertyType(System::SharedPtr< Serialization::JsonConverterBase > converter, const TypeInfo &propertyType)
System::SharedPtr< Serialization::JsonConverterBase > ExpandConverterFactory(System::SharedPtr< Serialization::JsonConverterBase > converter, const TypeInfo &typeToConvert)
void set_TypeInfoResolver(System::SharedPtr< Serialization::Metadata::IJsonTypeInfoResolver > value)
char16_t get_IndentCharacter()
void set_NewLine(String value)
void set_DefaultBufferSize(int32_t value)
System::SharedPtr< JsonNamingPolicy > get_PropertyNamingPolicy()
System::SharedPtr< Collections::Generic::IList< System::SharedPtr< Serialization::JsonConverterBase > > > get_Converters()
Definition: json_writer_options.h:31
Definition: json_node.h:54
Definition: json_node_options.h:14
Definition: json_value.h:60
Definition: json_value_of_t_customized.h:49
Definition: configuration_list.h:34
bool get_IsReadOnly() const override=0
Checks if collection is read only.
void SetTemplateWeakPtr(uint32_t argument) override
Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containe...
Definition: configuration_list.h:276
virtual void OnCollectionModifying()=0
Definition: object_converter.h:101
Definition: json_array_converter.h:44
Definition: json_node_converter.h:46
Definition: json_object_converter.h:50
Definition: json_value_converter.h:43
Definition: object_converter.h:46
Definition: object_default_converter.h:64
Definition: object_with_parameterized_constructor_converter.h:64
Definition: json_converter.h:76
Definition: json_converter_of_t.h:80
Definition: json_resumable_converter_of_t.h:42
Definition: json_serializer_context.h:36
Definition: json_metadata_services.h:118
Definition: json_property_info.h:80
Definition: json_property_info_of_t.h:69
Definition: json_type_info.h:106
Definition: json_type_info_of_t.h:84
Definition: polymorphic_type_resolver.h:52
Represents a particular type and provides information about it.
Definition: type_info.h:109
JsonIgnoreCondition
Definition: json_ignore_condition.h:15
JsonNumberHandling
Definition: json_number_handling.h:16
JsonCommentHandling
Definition: json_comment_handling.h:14
JsonSerializerDefaults
Definition: json_serializer_defaults.h:10
Definition: db_command.h:9
SmartPtr< X > MakeSharedPtr(X *p)
Converts raw pointer to smart pointer.
Definition: smart_ptr.h:1640
class ASPOSECPP_SHARED_CLASS WeakReference
Represents a weak reference, which references an object while still allowing that object to be delete...
Definition: weak_reference.h:13