Struct JsonDeserializationContext<TValue>
The JsonDeserializationContext<TValue> is available from adapters. It provides access to the current adapter enumerator and allows for control of deserialization for a given type.
Inherited Members
Namespace: Unity.Serialization.Json
Syntax
public readonly struct JsonDeserializationContext<TValue> : IJsonDeserializationContext
Type Parameters
| Name | Description |
|---|---|
| TValue | The value type being deserialized. |
Properties
SerializedValue
The in-memory representation of the value being deserialized.
Declaration
public readonly SerializedValueView SerializedValue { get; }
Property Value
| Type | Description |
|---|---|
| SerializedValueView |
Implements
Methods
ContinueVisitation()
Continues visitation for the current type. This will run the next adapter in the sequence, or the default behaviour and return the deserialized value.
Declaration
public readonly TValue ContinueVisitation()
Returns
| Type | Description |
|---|---|
| TValue | The deserialized value. |
ContinueVisitation(ref TValue)
Continues visitation for the current type. This will run the next adapter in the sequence, or the default behaviour and return the deserialized value.
Declaration
public readonly void ContinueVisitation(ref TValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| TValue | value | The value being deserialized. |
ContinueVisitation(ref TValue, SerializedValueView)
Continues visitation for the current type using the specified SerializedValueView. This will run the next adapter in the sequence, or the default behaviour and return the deserialized value.
Declaration
public readonly void ContinueVisitation(ref TValue value, SerializedValueView view)
Parameters
| Type | Name | Description |
|---|---|---|
| TValue | value | The value being deserialized. |
| SerializedValueView | view | A view on the serialized data. |
ContinueVisitation(SerializedValueView)
Continues visitation for the current type using the specified SerializedValueView. This will run the next adapter in the sequence, or the default behaviour and return the deserialized value.
Declaration
public readonly TValue ContinueVisitation(SerializedValueView view)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedValueView | view | A view on the serialized data. |
Returns
| Type | Description |
|---|---|
| TValue | The deserialized value. |
ContinueVisitationWithoutAdapters()
Continues visitation for the current type. This will run the next adapter in the sequence, or the default behaviour and return the deserialized value.
Declaration
public readonly TValue ContinueVisitationWithoutAdapters()
Returns
| Type | Description |
|---|---|
| TValue | The deserialized value. |
ContinueVisitationWithoutAdapters(ref TValue)
Continues visitation for the current type. This will invoke the default behaviour and return the deserialized value.
Declaration
public readonly void ContinueVisitationWithoutAdapters(ref TValue value)
Parameters
| Type | Name | Description |
|---|---|---|
| TValue | value | The value being deserialized. |
ContinueVisitationWithoutAdapters(ref TValue, SerializedValueView)
Continues visitation for the current type using the specified SerializedValueView. This will invoke the default behaviour and return the deserialized value..
Declaration
public readonly void ContinueVisitationWithoutAdapters(ref TValue value, SerializedValueView view)
Parameters
| Type | Name | Description |
|---|---|---|
| TValue | value | The value being deserialized. |
| SerializedValueView | view | A view on the serialized data. |
ContinueVisitationWithoutAdapters(SerializedValueView)
Continues visitation for the current type using the specified SerializedValueView. This will run the next adapter in the sequence, or the default behaviour and return the deserialized value.
Declaration
public readonly TValue ContinueVisitationWithoutAdapters(SerializedValueView view)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedValueView | view | A view on the serialized data. |
Returns
| Type | Description |
|---|---|
| TValue | The deserialized value. |
DeserializeValue<T>(SerializedValueView)
Reads the given SerializedValue as T and returns it. This will run all adapters.
Declaration
public readonly T DeserializeValue<T>(SerializedValueView view)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedValueView | view | A view on the serialized data. |
Returns
| Type | Description |
|---|---|
| T | The deserialized value. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the value being deserialized. |
Implements
GetInstance()
Gets the existing instance if overwriting; otherwise default.
Declaration
public readonly TValue GetInstance()
Returns
| Type | Description |
|---|---|
| TValue | The existing instance of |
Explicit Interface Implementations
IJsonDeserializationContext.ContinueVisitation()
Continues de-serialization for the current value. This will run the next adapter in the sequence, or the default behaviour.
Declaration
readonly object IJsonDeserializationContext.ContinueVisitation()
Returns
| Type | Description |
|---|---|
| Object | The deserialized value. |
Implements
IJsonDeserializationContext.ContinueVisitationWithoutAdapters()
Continues de-serialization for the current type without running any more adapters. This will perform the default behaviour.
Declaration
readonly object IJsonDeserializationContext.ContinueVisitationWithoutAdapters()
Returns
| Type | Description |
|---|---|
| Object | The deserialized value. |
Implements
IJsonDeserializationContext.GetInstance()
Gets the existing instance if overwriting; otherwise default.
Declaration
readonly object IJsonDeserializationContext.GetInstance()
Returns
| Type | Description |
|---|---|
| Object | The existing instance being deserialized in to, or default. |