org.as2lib.core.BasicClass +--org.as2lib.util.ClassUtil
ClassUtil
contains fundamental operations to efficiently and easily
work with any class. All methods here are supposed to be used with functions
treated as classes.
static public function isSubClassOf(subClass:Function, superClass:Function):Boolean
Checks if the passed-in subClass
is extended by the passed-in
superClass
.
subClass | the class to check |
superClass | the class to match |
true
if subClass
is a sub-class of superClass
static public function isImplementationOf(clazz:Function, interfaze:Function):Boolean
Checks if the passed-in clazz
implements the passed-in
interfaze.
clazz | the class to check |
interfaze | the interface the clazz may implement
|
true
if the passed-in clazz
implements the passed-in
interfaze
else false
static public function createCleanInstance(clazz:Function):Object
Creates a new instance of the passed-in clazz
without invoking its
constructor.
clazz | the class to create a new instance of |
new instance of the passed-in class.
static public function createInstance(clazz:Function, args:Array)
Creates a new instance of the passed-in clazz
applying the
passed-in args
to the constructor.
This util is mostly made for MTASC compatibility because it doesn't
allow new clazz()
for usual variables.
clazz | Class to be instanciated |
args | Arguments to be applied to the constructor |
new instance of the class