PropertyReflector class
Helper class to perform property introspection and dynamic reading and writing.
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 PropertyReflector treats all property names as case insensitive.
Example
var myObj = MyObject();
var properties = PropertyReflector.getPropertyNames();
PropertyReflector.hasProperty(myObj, 'myProperty');
var value = PropertyReflector.getProperty(myObj, 'myProperty');
PropertyReflector.setProperty(myObj, 'myProperty', 123);
Constructors
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
-
getProperties(
dynamic obj) → Map< String, dynamic> - Get values of all properties in specified object and returns them as a map.
-
getProperty(
dynamic obj, String name) → dynamic - Gets value of object property specified by its name.
-
getPropertyNames(
dynamic obj) → List< String> - Gets names of all properties implemented in specified object.
-
hasProperty(
dynamic obj, String name) → bool - Checks if object has a property with specified name..
-
setProperties(
dynamic obj, Map< String, dynamic> ? 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.