| Package | org.pranaframework.utils |
| Class | public class ClassUtils |
Class objects.
| Method | Defined by | ||
|---|---|---|---|
|
convertFullyQualifiedName(className:String):String
[static]
Converts the double colon (::) in a fully qualified class name to a dot (.)
| ClassUtils | ||
|
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 | ||
|
getFullyQualifiedImplementedInterfaceNames(clazz:Class, replaceColons:Boolean = false):Array
[static]
Returns an array of all fully qualified interface names that the
given class implements.
| ClassUtils | ||
|
getFullyQualifiedName(clazz:Class, replaceColons:Boolean = false):String
[static]
Returns the fully qualified name of the given class.
| ClassUtils | ||
|
getFullyQualifiedSuperClassName(clazz:Class, replaceColons:Boolean = false):String
[static]
Returns the fully qualified name of the given class' superclass.
| ClassUtils | ||
|
getImplementedInterfaceNames(clazz:Class):Array
[static]
Returns an array of all interface names that the given class implements.
| ClassUtils | ||
|
getImplementedInterfaces(clazz:Class):Array
[static]
Returns an array of all interface names that the given class implements.
| ClassUtils | ||
|
getName(clazz:Class):String
[static]
Returns the name of the given class.
| ClassUtils | ||
|
getNameFromFullyQualifiedName(fullyQualifiedName:String):String
[static]
Returns the name of the class or interface, based on the given fully
qualified class or interface name.
| ClassUtils | ||
|
getSuperClass(clazz:Class):Class
[static]
Returns the class that the passed in clazz extends.
| ClassUtils | ||
|
getSuperClassName(clazz:Class):String
[static]
Returns the name of the given class' superclass.
| 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 | ||
| convertFullyQualifiedName | () | method |
public static function convertFullyQualifiedName(className:String):StringConverts the double colon (::) in a fully qualified class name to a dot (.)
ParametersclassName:String |
String |
| 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
| getFullyQualifiedImplementedInterfaceNames | () | method |
public static function getFullyQualifiedImplementedInterfaceNames(clazz:Class, replaceColons:Boolean = false):ArrayReturns an array of all fully qualified interface names that the given class implements.
Parametersclazz:Class |
|
replaceColons:Boolean (default = false) |
Array |
| getFullyQualifiedName | () | method |
public static function getFullyQualifiedName(clazz:Class, replaceColons:Boolean = false):StringReturns the fully qualified name of the given class.
Parametersclazz:Class — the class to get the name from
|
|
replaceColons:Boolean (default = false) — whether the double colons "::" should be replaced by a dot "."
the default is false
|
String — the fully qualified name of the class
|
| getFullyQualifiedSuperClassName | () | method |
public static function getFullyQualifiedSuperClassName(clazz:Class, replaceColons:Boolean = false):StringReturns the fully qualified name of the given class' superclass.
Parametersclazz:Class — the class to get its superclass' name from
|
|
replaceColons:Boolean (default = false) — whether the double colons "::" should be replaced by a dot "."
the default is false
|
String — the fully qualified name of the class' superclass
|
| getImplementedInterfaceNames | () | method |
public static function getImplementedInterfaceNames(clazz:Class):ArrayReturns an array of all interface names that the given class implements.
Parametersclazz:Class |
Array |
| getImplementedInterfaces | () | method |
public static function getImplementedInterfaces(clazz:Class):ArrayReturns an array of all interface names that the given class implements.
Parametersclazz:Class |
Array |
| getName | () | method |
public static function getName(clazz:Class):StringReturns the name of the given class.
Parametersclazz:Class — the class to get the name from
|
String — the name of the class
|
| getNameFromFullyQualifiedName | () | method |
public static function getNameFromFullyQualifiedName(fullyQualifiedName:String):StringReturns the name of the class or interface, based on the given fully qualified class or interface name.
ParametersfullyQualifiedName:String — the fully qualified name of the class or interface
|
String — the name of the class or interface
|
| getSuperClass | () | method |
public static function getSuperClass(clazz:Class):ClassReturns the class that the passed in clazz extends. If no super class was found, in case of Object, null is returned.
Parametersclazz:Class — the class to get the super class from
|
Class |
| getSuperClassName | () | method |
public static function getSuperClassName(clazz:Class):StringReturns the name of the given class' superclass.
Parametersclazz:Class — the class to get the name of its superclass' from
|
String — the name of the class' superclass
|
| 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
|
* |