Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RecursiveObjectReader

Helper class to perform property introspection and dynamic reading.

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

see

PropertyReflector

see

ObjectReader

Hierarchy

  • RecursiveObjectReader

Index

Methods

Static getProperties

  • getProperties(obj: any): any
  • Get values of all properties in specified object and its subobjects and returns them as a map.

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

    Parameters

    • obj: any

      an object to get properties from.

    Returns any

    a map, containing the names of the object's properties and their values.

Static getProperty

  • getProperty(obj: any, name: string): any
  • Recursively gets value of object or 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.

    Parameters

    • obj: any

      an object to read property from.

    • name: string

      a name of the property to get.

    Returns any

    the property value or null if property doesn't exist or introspection failed.

Static getPropertyNames

  • getPropertyNames(obj: any): string[]
  • Recursively gets names of all properties implemented in specified object and its subobjects.

    The object can be a user defined object, map or array. Returned property name correspondently are object properties, map keys or array indexes.

    Parameters

    • obj: any

      an objec to introspect.

    Returns string[]

    a list with property names.

Static hasProperty

  • hasProperty(obj: any, name: string): boolean
  • Checks recursively if object or its subobjects has a property with specified 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.

    Parameters

    • obj: any

      an object to introspect.

    • name: string

      a name of the property to check.

    Returns boolean

    true if the object has the property and false if it doesn't.

Generated using TypeDoc