MethodReflector class

Helper class to perform method introspection and dynamic invocation.

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 MethodReflector treats all method names as case insensitive.

Example

var myObj =  MyObject();

var methods = MethodReflector.getMethodNames();
MethodReflector.hasMethod(myObj, 'myMethod');
MethodReflector.invokeMethod(myObj, 'myMethod', 123);

Constructors

MethodReflector()

Properties

hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited

Static Methods

getMethodNames(dynamic obj) → List<String>
Gets names of all methods implemented in specified object. [...]
hasMethod(dynamic obj, String name) → bool
Checks if object has a method with specified name.. [...]
invokeMethod(dynamic obj, String name, List args) → dynamic
Invokes an object method by its name with specified parameters. [...]