ObjectWriter class

Helper class to perform property introspection and dynamic writing.

In contrast to PropertyReflector which only introspects regular objects, this ObjectWriter is also able to handle maps and arrays. For maps properties are key-pairs identified by string keys, For arrays properties are elements identified by integer index.

This class has symmetric implementation across all languages supported by Pip.Services toolkit and used to support dynamic data processing.

Because all languages have different casing and case sensitivity rules, this ObjectWriter treats all property names as case insensitive. See PropertyReflector

Example

var myObj =  MyObject();

ObjectWriter.setProperty(myObj, 'myProperty', 123);

var myMap = { key1: 123, key2: 'ABC' };
ObjectWriter.setProperty(myMap, 'key1', 'XYZ');

var myArray = [1, 2, 3]
ObjectWriter.setProperty(myArray, '0', 123);

Constructors

ObjectWriter()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

setProperties(dynamic obj, Map values) → void
Sets values of some (all) object properties.
setProperty(dynamic obj, String name, dynamic value) → void
Sets value of object property specified by its name.