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
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
-
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.