Provider: added setproperty method
This commit is contained in:
@@ -40,4 +40,11 @@ class Provider {
|
||||
throw new Error("Factory for\"" + i + "\" not found");
|
||||
}
|
||||
}
|
||||
|
||||
public static function setProperty<T>(i:Class<T>, field:String, value:Dynamic, ?type:Dynamic):Void {
|
||||
var o:Dynamic = get(i, type);
|
||||
if (o != null && Reflect.hasField(o, field)) {
|
||||
Reflect.setProperty(o, field, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user