PureMVC Framework for haXe: API Documentation
Back | Index
class Reflect
The Reflect API is a way to manipulate values dynamicly through an abstract interface in an untyped manner. Use with care.

static function callMethod(o : Dynamic, func : Dynamic, args : Array<Dynamic>) : Dynamic
  Call a method with the given object and arguments.
static function compare<T>(a : T, b : T) : Int
  Generic comparison function, does not work for methods, see `compareMethods`
static function compareMethods(f1 : Dynamic, f2 : Dynamic) : Bool
  Compare two methods closures. Returns true if it's the same method of the same instance. Does not work on Neko platform.
static function copy<T>(o : T) : T
  Make a copy of the fields of an object.
static function deleteField(o : Dynamic, f : String) : Bool
  Delete an object field.
static function empty() : { }
  Creates an empty object.
static function field(o : Dynamic, field : String) : Dynamic
  Returns the field of an object, or null if `o` is not an object or doesn't have this field.
static function fields(o : Dynamic) : Array<String>
  Returns the list of fields of an object, excluding its prototype (class methods).
static function hasField(o : Dynamic, field : String) : Bool
  Tells if an object has a field set. This doesn't take into account the object prototype (class methods).
static function isFunction(f : Dynamic) : Bool
  Tells if a value is a function or not.
static function isObject(v : Dynamic) : Bool

  Tells if a value is an object or not.

static function makeVarArgs(f : Array<Dynamic> -> Dynamic) : Dynamic
  Transform a function taking an array of arguments into a function that can be called with any number of arguments.
static function setField(o : Dynamic, field : String, value : Dynamic) : Void
  Set an object field value.

Back | Index