Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RecursiveObjectWriter

Helper class to perform property introspection and dynamic writing.

It is similar to ObjectWriter but writes properties recursively through the entire object graph. Nested property names are defined using dot notation as "object.subobject.property"

see

PropertyReflector

see

ObjectWriter

Hierarchy

  • RecursiveObjectWriter

Index

Methods

Static copyProperties

  • copyProperties(dest: any, src: any): void
  • Copies content of one object to another object by recursively reading all properties from source object and then recursively writing them to destination object.

    Parameters

    • dest: any

      a destination object to write properties to.

    • src: any

      a source object to read properties from

    Returns void

Static setProperties

  • setProperties(obj: any, values: any): void
  • Recursively sets values of some (all) object and its subobjects properties.

    The object can be a user defined object, map or array. Property values correspondently are object properties, map key-pairs or array elements with their indexes.

    If some properties do not exist or introspection fails they are just silently skipped and no errors thrown.

    see

    setProperty

    Parameters

    • obj: any

      an object to write properties to.

    • values: any

      a map, containing property names and their values.

    Returns void

Static setProperty

  • setProperty(obj: any, name: string, value: any): void
  • Recursively sets value of object and its subobjects property specified by its name.

    The object can be a user defined object, map or array. The property name correspondently must be object property, map key or array index.

    If the property does not exist or introspection fails this method doesn't do anything and doesn't any throw errors.

    Parameters

    • obj: any

      an object to write property to.

    • name: string

      a name of the property to set.

    • value: any

      a new value for the property to set.

    Returns void

Generated using TypeDoc