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.
Implements
Inherited Members
Namespace: Unity.Serialization.Json
Assembly: Unity.Serialization.dll
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 SerializedValueView SerializedValue { get; }
Property Value
| Type | Description |
|---|---|
| SerializedValueView |
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 TValue ContinueVisitation()
Returns
| Type | Description |
|---|---|
| TValue | The deserialized value. |
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 TValue ContinueVisitation(SerializedValueView view)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedValueView | view | A view on the serialized data. |
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 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 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. |
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 TValue ContinueVisitationWithoutAdapters()
Returns
| Type | Description |
|---|---|
| TValue | The deserialized value. |
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 TValue ContinueVisitationWithoutAdapters(SerializedValueView view)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializedValueView | view | A view on the serialized data. |
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 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 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. |
DeserializeValue<T>(SerializedValueView)
Reads the given SerializedValue as T and returns it. This will run all adapters.
Declaration
public 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. |
GetInstance()
Gets the existing instance if overwriting; otherwise default.
Declaration
public TValue GetInstance()
Returns
| Type | Description |
|---|---|
| TValue | The existing instance of TValue or default. |