TypeReflector class

Helper class to perform object type introspection and object instantiation.

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 TypeReflector treats all type names as case insensitive.

See TypeDescriptor

Example

var descriptor =  TypeDescriptor('MyObject', 'mylibrary');
Typeeflector.getTypeByDescriptor(descriptor);
var myObj = TypeReflector.createInstanceByDescriptor(descriptor);

TypeDescriptor.isPrimitive(myObject); 		// Result: false
TypeDescriptor.isPrimitive(123);				// Result: true

Constructors

TypeReflector()

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

createInstance(String name, String library, List args) → dynamic
Creates an instance of an object type specified by its name and library where it is defined. [...]
createInstanceByDescriptor(TypeDescriptor descriptor, List args) → dynamic
Creates an instance of an object type specified by type descriptor. [...]
createInstanceByType(Type type, List args) → dynamic
Creates an instance of an object type. [...]
getType(String name, [ String library ]) → Type
Gets object type by its name and library where it is defined. [...]
getTypeByDescriptor(TypeDescriptor descriptor) → Type
Gets object type by type descriptor. [...]
isPrimitive(dynamic value) → bool
Checks if value has primitive type. [...]