docs.unity3d.com
    Show / Hide Table of Contents

    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
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    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
    IJsonDeserializationContext.SerializedValue

    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
    IJsonDeserializationContext.DeserializeValue<T>(SerializedValueView)

    GetInstance()

    Gets the existing instance if overwriting; otherwise default.

    Declaration
    public readonly TValue GetInstance()
    Returns
    Type Description
    TValue

    The existing instance of or default.

    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.ContinueVisitation()

    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.ContinueVisitationWithoutAdapters()

    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.

    Implements
    IJsonDeserializationContext.GetInstance()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023