Show / Hide Table of Contents

Class AbstractionMap

Provides an interface to map abstract and interface types to concrete types for object instantiation during deserialization.

Inheritance
System.Object
AbstractionMap
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Manatee.Json.Serialization
Assembly: Manatee.Json.dll
Syntax
public class AbstractionMap

Constructors

| Improve this Doc View Source

AbstractionMap()

Creates a new AbstractionMap instance.

Declaration
public AbstractionMap()
| Improve this Doc View Source

AbstractionMap(AbstractionMap)

Creates a new AbstractionMap instance using another as a basis.

Declaration
public AbstractionMap(AbstractionMap other)
Parameters
Type Name Description
AbstractionMap other

Properties

| Improve this Doc View Source

Default

Provides a default abstraction map for new JsonSerializer instances.

Declaration
public static AbstractionMap Default { get; }
Property Value
Type Description
AbstractionMap

Methods

| Improve this Doc View Source

GetMap(Type)

Retrieves the map setting for an abstraction type.

Declaration
public Type GetMap(Type type)
Parameters
Type Name Description
System.Type type

The abstraction type.

Returns
Type Description
System.Type

The mapped type if a mapping exists; otherwise the abstraction type.

| Improve this Doc View Source

Map<TAbstract, TConcrete>(MapBaseAbstractionBehavior)

Applies a mapping from an abstraction to a concrete type.

Declaration
public void Map<TAbstract, TConcrete>(MapBaseAbstractionBehavior mappingBehavior = MapBaseAbstractionBehavior.Unmapped)
    where TConcrete : TAbstract, new()
Parameters
Type Name Description
MapBaseAbstractionBehavior mappingBehavior

The mapping behavior.

Type Parameters
Name Description
TAbstract

The abstract type.

TConcrete

The concrete type.

Exceptions
Type Condition
JsonTypeMapException<TAbstract, TConcrete>

Thrown if TConcrete is an abstract class or an interface.

| Improve this Doc View Source

MapGeneric(Type, Type, MapBaseAbstractionBehavior)

Applies a mapping from an open generic abstraction to an open generic concrete type.

Declaration
public void MapGeneric(Type tAbstract, Type tConcrete, MapBaseAbstractionBehavior mappingBehavior = MapBaseAbstractionBehavior.Unmapped)
Parameters
Type Name Description
System.Type tAbstract

The abstract type.

System.Type tConcrete

The concrete type.

MapBaseAbstractionBehavior mappingBehavior

The mapping behavior.

Exceptions
Type Condition
JsonTypeMapException

Thrown if tConcrete is an abstract class or an interface or if tConcrete does not inherit from tAbstract.

| Improve this Doc View Source

RemoveMap<TAbstract>(Boolean)

Removes a previously-assigned mapping.

Declaration
public void RemoveMap<TAbstract>(bool removeRelated = true)
Parameters
Type Name Description
System.Boolean removeRelated

Optionally removes mappings of base and related interface types.

Type Parameters
Name Description
TAbstract

The type to remove.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX