| Package | org.pranaframework.utils |
| Class | public class ClassUtils |
Class objects.
| Method | Defined by | ||
|---|---|---|---|
|
forInstance(instance:*, applicationDomain:ApplicationDomain = null):Class
[static]
Returns a
Class object that corresponds with the given
instance. | ClassUtils | ||
|
forName(name:String, applicationDomain:ApplicationDomain = null):Class
[static]
Returns a
Class object that corresponds with the given
name. | ClassUtils | ||
|
getParentClass(clazz:Class):Class
[static]
Returns the class that the passed in clazz extends.
| ClassUtils | ||
|
isImplementationOf(clazz:Class, interfaze:Class):Boolean
[static]
Returns whether the passed in
Class object implements
the given interface. | ClassUtils | ||
|
isSubclassOf(clazz:Class, parentClass:Class):Boolean
[static]
Returns whether the passed in Class object is a subclass of the
passed in parent Class.
| ClassUtils | ||
|
newInstance(clazz:Class, args:Array = null):*
[static]
Creates an instance of the given class and passes the arguments to
the constructor.
| ClassUtils | ||
| forInstance | () | method |
public static function forInstance(instance:*, applicationDomain:ApplicationDomain = null):Class
Returns a Class object that corresponds with the given
instance. If no correspoding class was found, a
ClassNotFoundError will be thrown.
instance:* — the instance from which to return the class
|
|
applicationDomain:ApplicationDomain (default = null) — the optional applicationdomain where the instance's class resides
|
Class — the Class that corresponds with the given instance
|
See also
| forName | () | method |
public static function forName(name:String, applicationDomain:ApplicationDomain = null):Class
Returns a Class object that corresponds with the given
name. If no correspoding class was found in the applicationdomain tree, a
ClassNotFoundError will be thrown.
name:String — the name from which to return the class
|
|
applicationDomain:ApplicationDomain (default = null) — the optional applicationdomain where the instance's class resides
|
Class — the Class that corresponds with the given name
|
See also
| getParentClass | () | method |
public static function getParentClass(clazz:Class):ClassReturns the class that the passed in clazz extends. If no parent class was found, in case of Object, null is returned.
Parametersclazz:Class — the class to get the parent class from
|
Class |
| isImplementationOf | () | method |
public static function isImplementationOf(clazz:Class, interfaze:Class):Boolean
Returns whether the passed in Class object implements
the given interface.
clazz:Class — the class to check for an implemented interface
|
|
interfaze:Class — the interface that the clazz argument should implement
|
Boolean — true if the clazz object implements the given interface; false if not
|
| isSubclassOf | () | method |
public static function isSubclassOf(clazz:Class, parentClass:Class):BooleanReturns whether the passed in Class object is a subclass of the passed in parent Class.
Parametersclazz:Class |
|
parentClass:Class |
Boolean |
| newInstance | () | method |
public static function newInstance(clazz:Class, args:Array = null):*Creates an instance of the given class and passes the arguments to the constructor. TODO find a generic solution for this. Currently we support constructors with a maximum of 10 arguments.
Parametersclazz:Class — the class from which an instance will be created
|
|
args:Array (default = null) — the arguments that need to be passed to the constructor
|
* |