Class TypeMapConverter
- Namespace
- ActivityPub.Types.Conversion.Converters
- Assembly
- ActivityPub.Types.dll
Converts an object or value to or from JSON.
public class TypeMapConverter : JsonConverter<TypeMap>
- Inheritance
-
TypeMapConverter
- Inherited Members
Properties
NestedContextStack
Chain of contexts that inherit from each other. If a value is present, then it should be the parent of the current object's context.
private NestedContextStack NestedContextStack { get; }
Property Value
Methods
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type TypeMap.
public override TypeMap Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
reader
Utf8JsonReaderThe reader.
typeToConvert
TypeThe type to convert.
options
JsonSerializerOptionsAn object that specifies serialization options to use.
Returns
- TypeMap
The converted value.
ReadObject(JsonElement, JsonSerializerOptions)
private TypeMap ReadObject(JsonElement jsonElement, JsonSerializerOptions options)
Parameters
jsonElement
JsonElementoptions
JsonSerializerOptions
Returns
ReadString(JsonElement)
private TypeMap ReadString(JsonElement jsonElement)
Parameters
jsonElement
JsonElement
Returns
TryWriteAsLink(Utf8JsonWriter, TypeMap)
private static bool TryWriteAsLink(Utf8JsonWriter writer, TypeMap typeMap)
Parameters
writer
Utf8JsonWritertypeMap
TypeMap
Returns
Write(Utf8JsonWriter, TypeMap, JsonSerializerOptions)
Writes a specified value as JSON.
public override void Write(Utf8JsonWriter writer, TypeMap typeMap, JsonSerializerOptions options)
Parameters
writer
Utf8JsonWriterThe writer to write to.
typeMap
TypeMapoptions
JsonSerializerOptionsAn object that specifies serialization options to use.
WriteEntity(ASEntity, Type, JsonObject, SerializationMetadata)
private static void WriteEntity(ASEntity entity, Type entityType, JsonObject outputNode, SerializationMetadata meta)
Parameters
entity
ASEntityentityType
TypeoutputNode
JsonObjectmeta
SerializationMetadata
WriteTypeMap(TypeMap, JsonObject, SerializationMetadata)
private static void WriteTypeMap(TypeMap typeMap, JsonObject outputNode, SerializationMetadata meta)
Parameters
typeMap
TypeMapoutputNode
JsonObjectmeta
SerializationMetadata