Type

class TypeAvailable in flash8, flash, neko, js, php, cpp, cs, javaThe Haxe Reflection API enables you to retrieve information about variables, Classes and Enums at runtime. static function allEnums<T>( e : Enum<T> ) : Array<T>Returns the list of all enum values that don't take any parameter. static function createEmptyInstance<T>( cl : Class<T> ) : TSimilar to Type.createInstance excepts that the constructor is not called. This enables you to create an instance without any side-effect. static function createEnum<T>( e : Enum<T>, constr : String, ?params : Array<Dynamic> ) : TCreate an instance of an enum by using a constructor name and parameters. static function createEnumIndex<T>( e : Enum<T>, index : Int, ?params : Array<Dynamic> ) : TCreate an instance of an enum by using a constructor index and parameters. static function createInstance<T>( cl : Class<T>, args : Array<Dynamic> ) : TCreates an instance of the given class with the list of constructor arguments. static function enumConstructor( e : EnumValue ) : StringReturns the constructor of an enum static function enumEq<T>( a : T, b : T ) : BoolRecursively compare two enums constructors and parameters. static function enumIndex( e : EnumValue ) : IntReturns the index of the constructor of an enum. static function enumParameters( e : EnumValue ) : Array<Dynamic>Returns the parameters of an enum as a read-only Array. static function getClass<T>( o : T ) : Class<T>Returns the class of a value or null if this value is not a Class instance. static function getClassFields( c : Class<Dynamic> ) : Array<String>Returns the list of a class static fields' name. static function getClassName( c : Class<Dynamic> ) : StringReturns the complete name of a class. static function getEnum( o : EnumValue ) : Enum<Dynamic>Returns the enum of a value or null if this value is not an Enum instance. static function getEnumConstructs( e : Enum<Dynamic> ) : Array<String>Returns all the available constructor names for an enum. static function getEnumName( e : Enum<Dynamic> ) : StringReturns the complete name of an enum. static function getInstanceFields( c : Class<Dynamic> ) : Array<String>Returns the list of instance fields' name. static function getSuperClass( c : Class<Dynamic> ) : Class<Dynamic>Returns the super-class of a class, or null if no super class. static function resolveClass( name : String ) : Class<Dynamic>Evaluates a class from a name. The class must have been compiled to be accessible and if the Class is not in the same package, the full "dot path" must be given as part of the string.
Returns "null" if the class does not exist.
static function resolveEnum( name : String ) : Enum<Dynamic>Evaluates an enum from a name. The enum must have been compiled to be accessible. static function typeof( v : Dynamic ) : ValueTypeReturns the runtime type of a value.
version #15201, modified 2012-07-27 12:52:00 by AndyLi
0 comment